天天看點

成功解決AttributeError: 'BasicLSTMCell' object has no attribute '_kernel'+python下劃線用法的幾種常見用法了解

解決問題

AttributeError: 'BasicLSTMCell' object has no attribute '_kernel'

解決思路

Python 用下劃線作為變量字首和字尾指定特殊變量/方法。

主要存在四種情形

1. object                   # public

2. __object__          # special, python system use, user should not define like it

3. __object             # private (name mangling during runtime)

4. _object              # obey  coding convention, consider it as private

解決方法

該函數的新舊版本更替出現的問題,call函數修改為以前版本即可!

哈哈,大功告成!