当前位置:   article > 正文

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

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)


声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/2023面试高手/article/detail/102733
推荐阅读
相关标签
  

闽ICP备14008679号