'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