我的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