成功解决AttributeError: module 'numpy' has no attribute 'equal'
成功解决AttributeError: module 'numpy' has no attribute 'equal'
解决问题
ttributeError: module 'numpy' has no attribute 'equal'
Traceback (most recent call last):
File "F:\File_Python\Python_daydayup\190323.py", line 3, in <module>
import tensorflow
File "F:\Program Files\Python\Python36\lib\site-packages\tensorflow\__init__.py", line 22, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "F:\Program Files\Python\Python36\lib\site-packages\tensorflow\python\__init__.py", line 63, in <module>
from tensorflow.python.framework.framework_lib import * # pylint: disable=redefined-builtin
File "F:\Program Files\Python\Python36\lib\site-packages\tensorflow\python\framework\framework_lib.py", line 25, in <module>
from tensorflow.python.framework.ops import Graph
File "F:\Program Files\Python\Python36\lib\site-packages\tensorflow\python\framework\ops.py", line 40, in <module>
from tensorflow.python.eager import context
File "F:\Program Files\Python\Python36\lib\site-packages\tensorflow\python\eager\context.py", line 29, in <module>
from tensorflow.python.framework import c_api_util
File "F:\Program Files\Python\Python36\lib\site-packages\tensorflow\python\framework\c_api_util.py", line 25, in <module>
from tensorflow.python.util import compat
File "F:\Program Files\Python\Python36\lib\site-packages\tensorflow\python\util\compat.py", line 129, in <module>
解决思路
根据bug,可知,tensorflow版本有问题,换个tensorflow的版本
查看版本的方法
import tensorflow as tf print(tf.__version__)
解决方法
1、更新tensorflow:博主电脑上有多个版本的tensorflow库,将Anaconda的tensorflow版本更新到python库内即可!
2、更新numpy库
参考文章:成功解决from scipy.linalg import _fblas ImportError: DLL load failed: 找不到指定的模块。
3、最后的结果显示
哈哈,成功运行!