'NoneType' object has no attribute 'summary'


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'


免责声明!

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



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