当前位置: 首页> 娱乐> 明星 > yolov5-6.1训练过程中的问题总结

yolov5-6.1训练过程中的问题总结

时间:2025/7/13 17:47:08来源:https://blog.csdn.net/wyw0000/article/details/141293142 浏览次数:0次

目录

  • 1. torch安装问题
  • 2. ‘FreeTypeFont‘ object has no attribute ‘getsize‘报错解决
  • 3. RuntimeError: result type Float can't be cast to the desired output type __int64
  • 4. AttributeError: module 'numpy' has no attribute 'int'
  • 5. failed: module ‘signal‘ has no attribute ‘SIGALRM‘

1. torch安装问题

安装完anaconda并创建完虚拟环境后,执行下面命令安装yolov5需要的依赖

pip install -r requirements.txt

问题是:安装完后,发现torch竟然是CPU版本的,只能手动安装了。
torch下载地址
然后依次安装torch、torchaudio、torchvision

2. ‘FreeTypeFont‘ object has no attribute ‘getsize‘报错解决

将utils 文件下的 plots.py 文件做如下修改

# w, h = self.font.getsize(label)  # text width, height   ##这行注释掉x0, y0, x1, y1 = self.font.getbbox(label)  # text width, height    ## 粘贴这两行
w, h = x1-x0, y1-y0

参考链接

3. RuntimeError: result type Float can’t be cast to the desired output type __int64

请参看链接

4. AttributeError: module ‘numpy’ has no attribute ‘int’

将出现np.int的地方修改为np.int_即可。

5. failed: module ‘signal‘ has no attribute ‘SIGALRM‘

参考链接

关键字:yolov5-6.1训练过程中的问题总结

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: