这里简述一下我遇到的问题:

可以看到可用内存是大于需要被使用的内存的,但他依旧是报CUDA out of memory的错误

我的解决方法是:修改num_workers的值,把它改小一点,就行了,如果还不行

可以考虑使用以下方法:
1.减小batch_size
2.运行torch.cuda.empty_cache()函数
3.释放GPU内存,kill掉没用的进程
4.更改使用的显卡。这里大多指在服务器上运行,没有制定显卡,都默认使用第一张,或者多人使用,产生的不足。
参考链接:https://blog.csdn.net/weixin_41401924/article/details/120851573

【Pytorch】内存够用但还是 RuntimeError: CUDA out of memory 问题解决相关推荐

  1. python pytorch爆显存,内存溢出问题解决方法(总结)RuntimeError: CUDA out of memory.

    问题描述 在运行python程序时,随运行时间增长,内存疯狂增加,直至运行内存爆满,出现以下错误: RuntimeError: CUDA out of memory. 解决方法: 1.在模型验证和测试 ...

  2. pytorch出现RuntimeError: CUDA out of memory.

    无论batch-size设置多小也是会出现这个问题的,我的原因是我将pytorch升级到了1.0.1,然后出现了这个问题 RuntimeError: CUDA out of memory. Tried ...

  3. pytorch遇见RuntimeError: CUDA out of memory的解决

    RuntimeError: CUDA out of memory 1.查看是否其他程序占用显存 遇到此类错误后,对于py格式的文件来说,程序会进行终止,也就是当前程序占用的显存将会被释放.此时可用 w ...

  4. pytorch出现RuntimeError: CUDA out of memory的问题解决方法

    pytorch出现RuntimeError: CUDA out of memory解决方法 将batch-size设置小些试试,如果不行,继续第二步 多线程num_works设置较小,最差设为0

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

    报错内容: RuntimeError: CUDA out of memory. Tried to allocate 200.00 MiB (GPU 0; 8.00 GiB total capacity ...

  6. 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 ...

  7. 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 ...

  8. RuntimeError: CUDA out of memory

    报错内容: RuntimeError: CUDA out of memory. Tried to allocate 16.00 MiB (GPU 0; 2.00 GiB total capacity; ...

  9. 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; ...

最新文章

  1. 需求入门 - 获取需求方法:Nine Boxes
  2. 使用React,Redux和Router进行真正的集成测试
  3. 阿里云飞天洛神2.0:开放弹性的云网络NFV平台
  4. 用Html 和 Css来实现一个小小案例
  5. 中国邮路问题邮递员问题欧拉路径图论C++
  6. 之前项目从未写过的PO2VO
  7. MatCaffe问题: make matcaffe 'matlab/+caffe/private/caffe_.mexa64' failed
  8. idea添加scala环境_Scala(一)——scala+Idea环境配置
  9. 电力软件系统测试报告,电力巡检系统测试报告-软件工程
  10. 世界杯直播背后的黑科技 腾讯云极速高清技术驱动体育直播发展
  11. url %E4%BD%A0%E5%A5%BD 编码问题
  12. python卸载清理注册表_使用Python操作注册表
  13. 如何演示扇形面积公式推导过程
  14. 利用Java程序统计彩票双色球中一等奖究竟有多难
  15. 前端开发:遇到提示Invalid prop:type check failed for prop “modelValue“. Expected Number…的解决方法
  16. 计算机与投影仪的记录,投影仪和电脑的连接及PPT播放
  17. 1Tb 硬盘重做系统无法启动修复
  18. 2017腾讯暑期实习-产品经理二面(霸面)
  19. 谷歌中国ICP牌照过期 高管暗示员工自谋出路...
  20. 计算机软件系统的功能,软件系统由什么组成

热门文章

  1. 流氓软件卸载-MrWReSadse、Nexuser.exe、WRSvcmbdl.dll
  2. 京东测试之道,这些你早该知道!
  3. 人要感知到自己的渺小,行为才开始伟大
  4. msp430g2553串口接受数据_使用UART与PC通信实现msp430g2553单片机超声波测距示例
  5. android 拨打电话、 监听来电、监听呼出电话的功能实现
  6. 深入理解计算机系统(CSAPP) attack-lab详解
  7. ssm毕设项目企业门户网站f24qk(java+VUE+Mybatis+Maven+Mysql+sprnig)
  8. 微型计算机用什么做cpu,微型计算机的主机是由CPU、( )成。
  9. 【挑战学习一百天冲刺实习面试】第二十二天:全面理解BIO、NIO、AIO(完结)
  10. AGV与电梯交互系统设计