YOLO模型conda环境配置中的问题

本文讲述了在配置Yolo系列模型时遇到的两个常见错误:np.int类型的报错解决办法(升级或替换为np.int64),以及cuDNN算法找不到导致的RuntimeError,解决方法是调整较小的batch-size以适应显卡性能。
部署运行你感兴趣的模型镜像

下面的问题是我在配置yolo系列模型过程中遇到的报错问题,我将它汇总在这,这篇文章更新。

1.AttributeError: module 'numpy' has no attribute 'int'.

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:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

出现这一报错,是由于np.int属性在NumPy 1.20中被弃用,即不能再写np.int,解决办法有两种:

(1)降低numpy版本等级,降低到Numpy 1.20一下:直接输入以下指令:

pip install numpy==1.19.0

(2)按照报错指引依次将源码中np.int更改为np.int64

建议使用第2种方法,第1种方法可能存在库间的兼容性问题,容易引起其他报错

2.RuntimeError: Unable to find a valid cuDNN algorithm to run convolution

RuntimeError: Unable to find a valid cuDNN algorithm to run convolution

报错原因:电脑的显卡不支持过高的batch-size,只需调小batch-size即可。需要注意的是batch-size需要时2的倍数。我是从64降低到32便不再报错,这需根据自己的电脑显卡的大小来决定。

您可能感兴趣的与本文相关的镜像

Yolo-v5

Yolo-v5

Yolo

YOLO(You Only Look Once)是一种流行的物体检测和图像分割模型,由华盛顿大学的Joseph Redmon 和Ali Farhadi 开发。 YOLO 于2015 年推出,因其高速和高精度而广受欢迎

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值