报错内容:
RuntimeError: CUDA out of memory. Tried to allocate 200.00 MiB (GPU 0; 8.00 GiB total capacity; 5.96 GiB already allocated; 0 bytes free; 6.18 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

这个报错的意思就是:
运行时错误:CUDA内存不足。尝试分配200.00个MiB(GPU 0;8.00 GiB总容量;5.96 GiB已分配;0字节空闲;PyTorch总共保留6.18 GiB)如果保留内存>>已分配内存,请尝试设置最大拆分大小以避免碎片。

错误原因:
显卡内存不够,因为显卡内存不够大的话,当batch_size过大,那么处理的数据量就过大,训练时模型的所有参数都会参与计算,数据内存就会溢出,显卡内存就不够用了。

解决办法:
训练时候,将batch_size 改小点,例如:
python train.py --cuda --batch_size 64 --num_workers 0
改为:
python train.py --cuda --batch_size 2 --num_workers 0

使用GPU训练yolo_v2报错:RuntimeError: CUDA out of memory. Tried to allocate XXX MiB相关推荐

  1. 报错`RuntimeError: CUDA out of memory. Tried to allocate 256.00 MiB (GPU 0; 9.78 GiB total capaci

    报错RuntimeError: CUDA out of memory. Tried to allocate 256.00 MiB (GPU 0; 9.78 GiB total capacity; 8. ...

  2. 已解决yolov5报错RuntimeError: CUDA out of memory. Tried to allocate 14.00 MiB

    问题 RuntimeError: CUDA out of memory. Tried to allocate 14.00 MiB (GPU 0; 4.00 GiB total capacity; 2. ...

  3. Faster rcnn 训练coco2017数据报错 RuntimeError: CUDA error: device-side assert triggered

    Faster rcnn 训练coco2017数据报错 RuntimeError: CUDA error: device-side assert triggered 使用faster rcnn训练自己的 ...

  4. RuntimeError: CUDA out of memory. Tried to allocate 132.00 MiB (GPU 2; 3.95 GiB total capacity; 3.41

    pytorch报错:RuntimeError: CUDA out of memory. Tried to allocate 132.00 MiB (GPU 2; 3.95 GiB total capa ...

  5. RuntimeError: CUDA out of memory. Tried to allocate 50.00 MiB (GPU 0; 4.00 GiB total capacity; 682.9

    1. 问题 训练模型时报错: RuntimeError: CUDA error: out of memory CUDA kernel errors might be asynchronously re ...

  6. 爆显存:RuntimeError: CUDA out of memory. Tried to allocate 5.66 GiB (GPU 0; 12.00 GiB total capacity; 2

    报错:RuntimeError: CUDA out of memory. Tried to allocate 5.66 GiB (GPU 0; 12.00 GiB total capacity; 2. ...

  7. RuntimeError: CUDA out of memory. Tried to allocate 170.00 MiB (GPU 0; 3.82 GiB total capacity; 1.94

    错误: RuntimeError: CUDA out of memory. Tried to allocate 170.00 MiB (GPU 0; 3.82 GiB total capacity; ...

  8. RuntimeError: CUDA out of memory.Tried to allocate 20.00 MiB GPU 0 ,3.94 GiB total capacity 3.36 G

    RuntimeError: CUDA out of memory. Tried to allocate 20.00 MiB (GPU 0; 3.94 GiB total capacity; 3.36 ...

  9. RuntimeError: CUDA out of memory. Tried to allocate 1.54 GiB...

    报错 F:\Anaconda3\python.exe "E:/Program Files/PyCharm 2019.2/***/xxx.py" F:\Anaconda3\lib\s ...

最新文章

  1. CLR via C# 读书笔记 1-2 创建线程的成本
  2. matlab 十六进制数组,【MATLAB】MATLAB中读取二进制数据文件并加入到矩阵中
  3. 什么能在main()函数之前或之后执行
  4. 《Iterative-GAN》的算法伪代码整理
  5. 智器SmartQ T7实体店试用体验
  6. 经验与教训:测试员的偏向
  7. CentOS 6.2 中文
  8. 剑指offer:字符串的排列
  9. 64位Linux下安装iNode客户端
  10. 深度学习——时间序列模型评价指标总结
  11. html 页面数据显示不全,解决了一个Web网页显示不全的BUG
  12. R语言ARIMA-GARCH波动率模型预测股票市场苹果公司日收益率时间序列
  13. gnuplot用C语言程序画图,gnuplot使用
  14. 在mysql中查询时间最小的一条记录
  15. 【小5聊】winform窗体之最小化事件捕捉以及最小化到任务栏功能
  16. JAVA基础试题抄录
  17. 数据链路层 (一)------ 计算机网络(三)
  18. GemBox.Pdf v15Crack
  19. E0413: 不存在从 “std::string“ 到 “const char *“ 的适当转换函数
  20. PWA(Progressive Web App)初探总结

热门文章

  1. CF contest/382/B. Number Busters
  2. K8S自定义webhook实现认证管理
  3. 《机器学习的随机矩阵方法》
  4. Rising Temperature
  5. [cf] E - Gardener and Tree 拓扑排序
  6. atof()函数总是返回0.0
  7. redis跳跃表与二分查找
  8. C#.NET自动生成Excel图形报表
  9. 小学计算机课什么时候开设的,关于对农村小学信息技术课程开设情况的调查
  10. strongSwan编译