Python3-AttributeError: module 'tensorflow' has no attribute 'Variable'

在運行Python3程序的時候,程序一直在跑,突然之間報錯: AttributeError: module 'tensorflow' has no attribute 'Variable' 問題原因:該py文件命名爲了tensorflow.py  根據python的調用機制,它會優先import 項目中的tensorflow,從而沒有各種方法。 解決辦法:將命名修改了,重新運行就ok。
相關文章
相關標籤/搜索