resnet icon indicating copy to clipboard operation
resnet copied to clipboard

cannot import name '_obtain_input_shape'

Open jmtatsch opened this issue 5 years ago • 1 comments

When using more current keras versions like 2.2.2 keras.applications.imagenet_utils can not be found because it has been moved to keras_applications.imagenet_utils

Traceback (most recent call last):
  File "example.py", line 1, in <module>
    import resnet
  File "/usr/local/lib/python3.6/site-packages/resnet-0.1-py3.6.egg/resnet/__init__.py", line 2, in <module>
    from .resnet152 import ResNet152
  File "/usr/local/lib/python3.6/site-packages/resnet-0.1-py3.6.egg/resnet/resnet152.py", line 27, in <module>
    from keras.applications.imagenet_utils import _obtain_input_shape
ImportError: cannot import name '_obtain_input_shape'

jmtatsch avatar Aug 27 '18 15:08 jmtatsch

You are facing this probelm because you are using a newer version of kears Just change from keras.applications.imagenet_utils import _obtain_input_shape to from keras_applications.imagenet_utils import _obtain_input_shape

manideep2510 avatar Jan 28 '19 19:01 manideep2510