resnet
resnet copied to clipboard
cannot import name '_obtain_input_shape'
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'
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