ImportError: cannot import name '_obtain_input_shape' from 'keras.applications.imagenet_utils'

原文链接: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:\Anaconda3\lib\site-packages\keras\applications\imagenet_utils.py)
  • 原因
    _obtain_input_shape换地方了
  • 解决
    from keras.applications.imagenet_utils import _obtain_input_shape
    改成
    from keras_applications.imagenet_utils import _obtain_input_shape
posted @ 2019-07-09 15:00  鹏懿如斯  阅读(2417)  评论(1编辑  收藏  举报