Unable to load keras dependencies
icarocd opened this issue · 2 comments
icarocd commented
I am using python3 and keras 2.2.4, with tensorflow backend.
In vgg16_places_365.py,
the following import
from keras.applications.imagenet_utils import _obtain_input_shape
gives this error:
ImportError: cannot import name '_obtain_input_shape'
Am I supposed to use a particular Keras version?
GKalliatakis commented
No Keras-VGG16-places365 is compatible with all Keras versions.
The issue you are facing might be coming from the way you are importing imagenet_utils.
imagenet_utils are now part of the keras-applications/keras_applications so you need to import them accordingly (from keras import applications)
icarocd commented
Thanks.
It worked with:
from keras_applications.imagenet_utils import _obtain_input_shape