AttributeError: module ‘numpy‘ has no attribute ‘int‘. `np.int` was a deprecated alias for the built

该文章已生成可运行项目,

报错:AttributeError: module ‘numpy’ has no attribute ‘int’.
np.int was a deprecated alias for the builtin int. To avoid this error in existing code, use int by itself. Doing this will not modify any behavior and is safe. When replacing np.int, you may wish to use e.g. np.int64 or np.int32 to specify the precision. If you wish to review your current use, check the release note link for additional information.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
原因是该错误是由于使用了已弃用的 numpy 模块中的 np. int 别名。从 NumPy 1.20版本开始,np.int 已被移除,建议直接使用 Python 内置的 int 类型或指定精度的 NumPy 整数类型(如 np. int64 或 np. int32)
原代码:

classes_nums=np.zeros([256],np.int)

修改后:
在这里插入图片描述

本文章已经生成可运行项目
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值