No module named 'tensorflow.python.tools',AttributeError: 'module' object has no attribute 'copy'
2020-04-09 12:41
791 查看
#1.pycharm程序运行一直正常,但是突然报错,找不到原因
运行结构显示No module named ‘tensorflow.python.tools’; 按照其他博客所说的卸载tensorflow然后重装都没有成功,因为之前安装的tensorflow的cpu版本,考虑到是不是版本问题然后改成gpu版本,结果还是一样的报错。
#2.查找原因
然后就在anaconda目录下查看tensorflow的文件夹,发现这个文件夹下面没有.tools这个文件目录,这时候我直接将tensorflow_core中的所有文件复制到上面的tensorflow文件下面,然后运行,这时候这个问题没有了,但是出现了新的问题。
上面这个tensorflow的文件是我从tensorflow_core文件copy进去的
#3出现这个错误:AttributeError: ‘module’ object has no attribute ‘copy’
这时候想明白了,因为我之所以出现上述一系列问题,是我在命名一个python文件的时候直接用了copy这个单词,删除该文件之后就解决了所有的问题,这个真的是太坑了!!!
- 点赞
- 收藏
- 分享
- 文章举报
相关文章推荐
- tensorflow AttributeError: 'module' object has no attribute 'cpu_count'
- AttributeError: module 'tensorflow.python.ops.nn' has no attribute 'leaky_relu'
- AttributeError: module 'tensorflow.python.platform.flags' has no attribute 'mark_flag_as_required'
- AttributeError: module 'tensorflow.python.ops.nn' has no attribute 'seq2seq'
- Python错误AttributeError: 'module' object has no attribute 'copy'
- tensorflow AttributeError: 'module' object has no attribute 'cpu_count'
- Tensorflow protobuf版本报错问题解决(AttributeError: 'module' object has no attribute 'Default')
- Python问题 : AttributeError: 'module' object has no attribute 'SSL_ST_INIT' 解决办法
- Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法
- python运行不了 AttributeError: module object has no attribute getdefaultlocale
- python 错误解析 AttributeError: 'module' object has no attribute 'dumps'
- Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法
- 关于Tensorflow AttributeError: 'NoneType' object has no attribute 'keys'的问题
- Python:AttributeError: ‘module’ object has no attribute ‘ArgumentParser’
- Python脚本报错AttributeError: ‘module’ object has no attribute ’urllibopen'(Python 2.7.11 )
- AttributeError: 'module' object has no attribute 'AF_INET'处理办法——python
- 关于import tensorflow as tf的错误:AttributeError: type object 'NewBase' has no attribute 'is_abstract'
- AttributeError: module 'tensorflow.contrib.linalg' has no attribute 'LinearOperator'
- Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法
- tensorFlow解决问题ImportError: No module named 'tensorflow.python.pywrap_tensorflow_internal'