下面的问题是我在配置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便不再报错,这需根据自己的电脑显卡的大小来决定。