Reputation: 306
I am trying to import
import tensorflow.python.keras.applications
but it gives the bellow error:
ModuleNotFoundError: No module named 'tensorflow.python.keras.applications'
my TensorFlow version is 2.8.0 and Keras version is 2.8.0
Upvotes: 4
Views: 24762
Reputation: 123
I ran into a similar issue. I was following a tutorial that was developed for older versions of Tensorflow and Keras. I was able to import everything I needed from here:
import keras._tf_keras.keras
I'm using Tensorflow version 2.16.1 and Keras version 3.4.0.
Upvotes: 0
Reputation: 36
No need to downgrade or uninstall tensorflow. The resolution of this error resides in resnet_v1.py file i changed the foll line:
from tensorflow.python.keras.applications import resnet
to
from tensorflow.keras.applications import resnet
and it got resolved because tensorflow.python is deprecated long time ago.
Upvotes: 2
Reputation: 31
my solution was downgrade tensorflow to 2.7
!pip uninstall tensorflow !pip install tensorflow==2.7
Upvotes: 3
Reputation: 81
Try using import keras.applications
instead of import tensorflow.python.keras.applications
Upvotes: 8
Reputation: 306
I was able to fix the problem by uninstalling TensorFlow and installing it back.
pip uninstall tensorflow
pip install tensorflow
Upvotes: 0