美文网首页
AttributeError: module 'numpy' h

AttributeError: module 'numpy' h

作者: wxyzcctn | 来源:发表于2023-07-28 16:54 被阅读0次

我的NVIDIA显卡的型号是GeForce GTX 1050Ti,安装的cuda是11.2的,cuDnn是8.1的,python是3.8的,numpy是1.24.3的,创建conda环境之后,使用conda install tensorflow-gpu==2.5进行安装,安装成功之后在 .py 文件中运行如下代码:

import tensorflow as tf

报错信息为:

AttributeError: module 'numpy' has no attribute 'object'.
`np.object` was a deprecated alias for the builtin `object`. To avoid this error in existing code, use `object` by itself. Doing this will not modify any behavior and is safe.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

解决方法是将您的numpy版本修复到仍然支持使用 np.object 的最后一个版本1.23.4 pip install numpy==1.23.4

相关文章

网友评论

      本文标题:AttributeError: module 'numpy' h

      本文链接:https://www.haomeiwen.com/subject/jxcdpdtx.html