原文链接:http://www.one2know.cn/bug8/
- 报错
Using TensorFlow backend.
Traceback (most recent call last):
File "D:/PyCharm 5.0.3/WorkSpace/3.Keras/2.Application中五款已训练模型、VGG16框架(Sequential式、Model式)解读/2.py", line 22, in <module>
from keras.applications.imagenet_utils import _obtain_input_shape
ImportError: cannot import name '_obtain_input_shape' from 'keras.applications.imagenet_utils' (D:Anaconda3libsite-packageskerasapplicationsimagenet_utils.py)
- 原因
_obtain_input_shape
换地方了 - 解决
from keras.applications.imagenet_utils import _obtain_input_shape
改成
from keras_applications.imagenet_utils import _obtain_input_shape