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

在运行Python3程序的时候,程序一直在跑,突然之间报错:

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

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

问题原因:该py文件命名为了tensorflow.py 

根据python的调用机制,它会优先import 项目中的tensorflow,从而没有各种方法。

解决办法:将命名修改了,重新运行就ok。