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 capacity; 3.41 GiB already allocated; 37.88 MiB free; 98.29 MiB cached)
如果是训练时遇到该问题,说明模型的参数太多了,将模型的参数减少该问题就解决了,改小batch_size是不能解决的(我将batch_size设为1都没解决,而且报错时的内存数据都没变)
如果是测试时遇到该问题,在测试代码前面加上:with torch.no_grad():
with torch.no_grad():# test process
ps:程序运行中可以通过watch -n 0.1 -d nvidia-smi命令来实时查看GPU占用情况,按Ctrl+c退出:
因为我使用的是2号GPU,当我的程序一运行,可以看到2号GPU的占用内存从1MiB一直飙升,直至接近4043MiB,然后就报错上面的RuntimeError
RuntimeError: CUDA out of memory. Tried to allocate 132.00 MiB (GPU 2; 3.95 GiB total capacity; 3.41相关推荐
- 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 ...
- 报错`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. ...
- 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; ...
- 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 ...
- 解决:RuntimeError: CUDA out of memory. Tried to allocate 64.00 MiB (GPU 0; 4.00 GiB total capacity; 2
引发pytorch:CUDA out of memory错误的原因有两个: 1.当前要使用的GPU正在被占用,导致显存不足以运行你要运行的模型训练命令不能正常运行 解决方法: 1.换另外的GPU 2. ...
- [881]内存不足RuntimeError: CUDA out of memory. Tried to allocate 16.00 MiB (GPU 0; 2.00 GiB total cap...
今天第一次在服务器上跑代码 也是第一次接触cuda显存卡 碰到了标题问题 将解决办法记录下来 1. 首先去查看cuda显存占用情况: nvidia-smi 显示所有GPU的当前信息状态(图源网络 不想 ...
- RuntimeError: CUDA out of memory. Tried to allocate 20.00 MiB (GPU 0; 4.00 GiB total capacity; 2.44
调试手写数字识别代码时出现的问题,将cpu的代码改用gpu训练时虽然可以训练,详见上一条博客(Mnist手写数字识别cpu训练与gpu训练),但是会出现Error.查找资料后以下是解决过程. 先说结论 ...
- CUDA out of memory. Tried to allocate 392.00 MiB (GPU 0; 10.76 GiB total capacity; 652.77 MiB alread
在使用Pytorch中,出现CUDA out of memory. Tried to allocate 392.00 MiB (GPU 0; 10.76 GiB total capacity; 652 ...
- 已解决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
- ORA-20000 exec dbms_space 错误
- 阿里雷卷:RSocket从入门到落地,RSocket让AJP换发青春
- 每日一笑 | 男朋友整天沉迷游戏怎么办...?
- 服务器文件每天备份重新命名,定时备份服务器文件至本地电脑
- 每日一题(49)—— 有符号数与无符号数
- edge浏览器扩展插件中心10月发布 可直接安装Chrome扩展
- html5设置data,HTML5自定义data属性
- opencv qt5安装linux,Ubuntu OpenCV安装和设置(Qt5吗?)
- 上计算机绘图的心得,计算机绘图学习心得体会.doc
- mod sim tcp配置_ModSim32和ModScan32两种Modbus调试工具使用说明
- Linkedin领英如何添加或更改账号的邮箱地址的方法和细节,让我们更高效的运用领英
- plsql破解的办法
- 输出数组元素(c语言)
- 单片机程序运行在哪里
- 10年后,程序员的薪资还会这么高么?
- 数据结构-单链表基本操作带图完整详解
- 20220509数据结构绿书读书笔记
- C++求1-20的阶乘之和
- 阿里开源支持10万亿模型的自研分布式训练框架EPL