首页 > Web开发 > 详细

'NoneType' object has no attribute 'summary'

时间:2020-04-04 23:59:50      阅读:488      评论:0      收藏:0      [点我收藏+]

1. 什么是NoneType

来自stackoverflow上的回答:NoneType is the type for the None object, which is an object that indicates no valueNone is the return value of functions that "don‘t return anything". It is also a common default return value for functions that search for something and may or may not find it;

2 . 出现的问题

问题代码如下

1 model = AE()
2 model = model.build(input_shape=(None, 784))
3 model.summary()

第2行代码出错了,model.build()是不返回什么的。所以此时model变成了NoneType object,而NoneType object并没有summary属性,所以直接报错‘NoneType‘ object has no attribute ‘summary‘

'NoneType' object has no attribute 'summary'

原文:https://www.cnblogs.com/zhenlingmo/p/12634362.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!