'NoneType' object has no attribute 'summary'

时间:2020-04-04 23:59:50   收藏:0   阅读:490

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‘

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

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!