赞
踩
报错:
'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.
报错原因:
从numpy1.24起删除了numpy.bool、numpy.int、numpy.float、numpy.complex、numpy.object、numpy.str、numpy.long、numpy.unicode类型的支持。
方法一:修改numpy版本
安装numpy1.24之前的版本
pip install numpy==1.23.5
方法二:修改代码
np.float替换为float或者np.float64/np.float3
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。