当前位置:网站首页>RuntimeError: CUDA out of memory(已解决)[通俗易懂]
RuntimeError: CUDA out of memory(已解决)[通俗易懂]
2022-07-25 14:05:00 【全栈程序员站长】
大家好,又见面了,我是你们的朋友全栈君。
今天用pytorch训练神经网络时,出现如下错误:
RuntimeError: CUDA out of memory. Tried to allocate 144.00 MiB (GPU 0; 2.00 GiB total capacity; 1.29 GiB already allocated; 79.00 MiB free; 1.30 GiB reserved in total by PyTorch)
明明 GPU 0 有2G容量,为什么只有 79M 可用? 并且 1.30G已经被PyTorch占用了。这就说明PyTorch占用的GPU空间没有释放,导致下次运行时,出现CUDA out of memory。
解决方法如下:
(1)新建一个终端
(2)输入 nvidia-smi,会显示GPU的使用情况,以及占用GPU的应用程序
(3)输入taskkill -PID 进程号 -F 结束占用的进程,比如 taskkill -PID 7392 -F
(4)再次输入 nvidia-smi 查看GPU使用情况,会发现GPU被占用的空间大大降低,这样我们就可以愉快地使用GPU运行程序了
【参考文档】
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/127655.html原文链接:https://javaforall.cn
边栏推荐
- 金鱼哥RHCA回忆录:CL210管理存储--对象存储
- CDA level Ⅰ 2021 new version simulation question 1 (with answers)
- Brush questions - Luogu -p1150 Peter's smoke
- Lesson of C function without brackets
- Mongodb source code deployment and configuration
- @Wrap decorator
- Leetcode202 --- Happy number
- telnet远程登录aaa模式详解【华为eNSP】
- Tm1637 four digit LED display module Arduino driver with second dot
- What financial products can I invest with some money in my hand?
猜你喜欢
![【Platform IO编译Hifive1-revB】*** [.pio\build\hifive1-revb\src\setupGPIO.o] Error 1的解决办法](/img/a1/de197464e2a735d7ef012cea780da5.png)
【Platform IO编译Hifive1-revB】*** [.pio\build\hifive1-revb\src\setupGPIO.o] Error 1的解决办法

Leetcode -- addition of four numbers II

Advantages of wireless relay acquisition instrument and wireless network for engineering monitoring

Internal error of LabVIEW

Mysql表的操作

leetcode--四数相加II

Pytest.mark.parameterize and mock use

Mongodb源码部署以及配置

Practice of online problem feedback module (13): realize multi parameter paging query list

Applet sharing function
随机推荐
GCD details
maya建模练习
Practice of online problem feedback module (13): realize multi parameter paging query list
高版本MySQL服务端安装不上怎么办,忘记密码(MySQL8.0.29)?
【目录爆破工具】信息收集阶段:robots.txt、御剑、dirsearch、Dirb、Gobuster
[directory blasting tool] information collection stage: robots.txt, Yujian, dirsearch, dirb, gobuster
wangeditor 富文本编辑器
数字孪生 - 认知篇
Applet H5 get mobile number scheme
NoSQL, relational database, row and column database comparison and analogy
[原创]九点标定工具之机械手头部相机标定
Pytest.mark.parameterize and mock use
How happy is the frisbee bureau? 2022 youth trendy Sports Report
金鱼哥RHCA回忆录:CL210管理存储--对象存储
Application engineering safety monitoring of wireless vibrating wire acquisition instrument
Data analysis business core
Framework package merge script
应急科普|收好这份暑期安全指南,让孩子安全过暑假!
Three ways of redis cluster
Mongodb源码部署以及配置