ImportError: cannot import name ‘_obtain_input_shape’ from keras

You don’t have to downgrade Keras 2.2.2.

In Keras 2.2.2 there is no _obtain_input_shape method in the keras.applications.imagenet_utils module. You can find it under keras-applications with the modul name keras_applications (underscore).

So you don’t have to downgrade your Keras to 2.2.0 just change:

from keras.applications.imagenet_utils import _obtain_input_shape

to

from keras_applications.imagenet_utils import _obtain_input_shape

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)