Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot import name '_obtain_input_shape' #2

Open
jmtatsch opened this issue Aug 27, 2018 · 1 comment
Open

cannot import name '_obtain_input_shape' #2

jmtatsch opened this issue Aug 27, 2018 · 1 comment

Comments

@jmtatsch
Copy link

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 added a commit to jmtatsch/resnet that referenced this issue Aug 27, 2018
@manideep2510
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants