您的位置: 首页 > 文章 > Python3-AttributeError: module 'tensorflow' has no attribute 'Variable' Python3-AttributeError: module 'tensorflow' has no attribute 'Variable' 分类: 文章 • 2023-04-05 16:04:35 在运行Python3程序的时候,程序一直在跑,突然之间报错: AttributeError: module 'tensorflow' has no attribute 'Variable' 问题原因:该py文件命名为了tensorflow.py 根据python的调用机制,它会优先import 项目中的tensorflow,从而没有各种方法。 解决办法:将命名修改了,重新运行就ok。