当前位置:   article > 正文

成功解决AttributeError: module 'numpy' has no attribute 'equal'_python 3.8.17 tensorflow attributeerror: module 'n

python 3.8.17 tensorflow attributeerror: module 'numpy' has no attribute 'ob

成功解决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的版本

查看版本的方法

  1. import tensorflow as tf
  2. print(tf.__version__)

 

 

 

 

 

 

 

解决方法

1、更新tensorflow:博主电脑上有多个版本的tensorflow库,将Anaconda的tensorflow版本更新到python库内即可!

2、更新numpy库

参考文章:成功解决from scipy.linalg import _fblas ImportError: DLL load failed: 找不到指定的模块。

 

3、最后的结果显示

 

哈哈,成功运行!

 

 

 

 

 

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/凡人多烦事01/article/detail/224889
推荐阅读
相关标签
  

闽ICP备14008679号