目录
问题描述
- python 3.5
- tensorflow 1.3 CPU
编译python文件时,报错:’NoneType’ object has no attribute ‘TF_DeleteStatus’,如下所示:
Exception ignored in: <bound method BaseSession.__del__ of <tensorflow.python.client.session.Session object at 0x1202ad9b0>>
Traceback (most recent call last):
File "/Applications/anaconda/envs/tensorflow/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 581, in __del__
AttributeError: 'NoneType' object has no attribute 'TF_DeleteStatus'
解决办法
这是因为没有删除之前编译时生成的.pyc文件,需要删除整个__pycache__
文件夹,如下图:
文件夹删除后,就可以正常运行了。