记录YOLOv5运行train.py出现的问题

目录

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

2.RuntimeError: result type Float can't be cast to the desired output type long int

3.运行很慢很慢,gpu占用率低低低

4.OutOfMemoryError: CUDA out of memory. Tried to allocate 50.00 MiB (GPU 0; 23.65 GiB total capacity; 21.91 GiB already allocated; 4.56 MiB free; 22.06 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation.  See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF


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

解决方法:AttributeError: module numpy has no attribute int .报错解决方案_小恶魔饿了的博客-CSDN博客

2.RuntimeError: result type Float can't be cast to the desired output type long int

解决方法:

解决错误:RuntimeError: result type Float can‘t be cast to the desired output type __int64_result type float can't be cast to the desired out_顾悦西的博客-CSDN博客

3.运行很慢很慢,gpu占用率低低低

解决方法:

YOLOv5训练速度慢 GPU占用率低_Goyavae的博客-CSDN博客

会快一点,gpu使用率明显高了一点(呜呜,也没有高很多)

我还是觉得不够快,于是:

使用GPU训练深度模型时,GPU显存占用低,利用率显示为0,而CPU占用很高。请问这怎么解决呢? - 知乎 (zhihu.com)

我把batch-size调整了,调整到100和我的epochs一样,结果出错:

4.OutOfMemoryError: CUDA out of memory. Tried to allocate 50.00 MiB (GPU 0; 23.65 GiB total capacity; 21.91 GiB already allocated; 4.56 MiB free; 22.06 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation.  See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

解决办法:

训练yolov5时,RuntimeError: CUDA out of memory._yolo memoryerror_口在天上,数在心中的博客-CSDN博客

于是我又把batch-size改小到50,不行;改到30还是不行;我改到10终于就可以了,也要更快一些,占用gpu也要更多一些

参考:

深度学习训练中的GPU利用率和显存占用问题、num_workers&batch_size设置问题 - 知乎 (zhihu.com)


  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值