TypeError: _obtain_input_shape() got an unexpected keyword argument 'include_top'


原文链接:http://www.one2know.cn/bug9/

  • 报错
Traceback (most recent call last):
  File "D:/PyCharm 5.0.3/WorkSpace/3.Keras/2.Application中五款已训练模型、VGG16框架(Sequential式、Model式)解读/2.py", line 159, in <module>
    model = VGG16(include_top=True, weights='imagenet')
  File "D:/PyCharm 5.0.3/WorkSpace/3.Keras/2.Application中五款已训练模型、VGG16框架(Sequential式、Model式)解读/2.py", line 51, in VGG16
    include_top=include_top)
TypeError: _obtain_input_shape() got an unexpected keyword argument 'include_top'
  • 原因
    没有叫include_top的参数
  • 解决
    打开keras.applications.imagenet_utils找到preprocess_input()函数,def _obtain_input_shape(input_shape, default_size, min_size, data_format, require_flatten, weights=None):
    将参数include_top改成require_flatten


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM