[已解决]AttributeError: module ‘numpy‘ has no attribute ‘float‘

1、问题: AttributeError: module 'numpy' has no attribute 'float'

`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.

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

2、解决方法[参考]

conda list

降低numpy 版本:

python 复制代码
pip uninstall numpy
pip install numpy==1.23.5
相关推荐
奈斯。zs4 小时前
yjs08——矩阵、数组的运算
人工智能·python·线性代数·矩阵·numpy
Trouvaille ~15 小时前
【Python篇】深度探索NumPy(下篇):从科学计算到机器学习的高效实战技巧
图像处理·python·机器学习·numpy·信号处理·时间序列分析·科学计算
985小水博一枚呀1 天前
【梯度消失|梯度爆炸】Vanishing Gradient|Exploding Gradient——为什么我的卷积神经网络会不好呢?
人工智能·python·深度学习·神经网络·计算机视觉·cnn·numpy
python1562 天前
Python Numpy布尔数组在数据分析中的应用
python·数据分析·numpy
zhangfeng11332 天前
python numpy pytorch tensorlfow list 转tenser float 32的方法,模型计算基本用的都是float32,需要转换
pytorch·python·numpy
Trouvaille ~2 天前
【Python篇】NumPy完整指南(上篇):掌握数组、矩阵与高效计算的核心技巧
python·机器学习·数学建模·数据分析·numpy·科学计算·大数据处理
985小水博一枚呀3 天前
【深度学习|PyTorch】基于 PyTorch 搭建 U-Net 深度学习语义分割模型——附代码及其解释!
网络·人工智能·pytorch·python·深度学习·conda·numpy
MonkeyKing_sunyuhua4 天前
实现从 Milvus 中获取数据,并基于嵌入向量重新排序的功能
numpy·milvus
aloha_7895 天前
如何理解深度学习的训练过程
人工智能·python·深度学习·numpy·virtualenv·pandas·scikit-learn
Thetoicxdude5 天前
[Day 76] 區塊鏈與人工智能的聯動應用:理論、技術與實踐
人工智能·web3·numpy