您的位置:首页 > 其它

tensorflow 报错: AttributeError: module 'tensorflow' has no attribute 'xxxx'

2017-11-09 10:02 1206 查看
____tz_zs

用的好好的 tensorflow 突然出现:能导入tensorflow 包,但是使用任何 tensorflow 下的模块都报“不存在”的错误。
如:使用 tf.Variable 创建一个变量也会报 AttributeError: module 'tensorflow' has no attribute 'Variable '。

原因是 tensorflow 变成了一个没有任何内容的模块(导致 tensorflow 变为空的原因未知)
解决办法:卸载 tensorflow (根据你所安装的 pip uninstall tensorflow 或者 pip uninstall tensorflow-gpu)然后重新安装(根据你所安装的 pip install tensorflow 或者 pip install tensorflow-gpu)

ps:根据谷歌查询到的一些讨论信息,windows 下安装 tensorflow 时也曾出现过安装得到的 tensorflow 为空的现象,可能是因为权限问题。

附:
Windows下TensorFlow的安装:http://blog.csdn.net/tz_zs/article/details/74779953

github 类似问题的讨论:https://github.com/tensorflow/tensorflow/issues/7285
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  tensorflow bug
相关文章推荐