当前位置:网站首页>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
边栏推荐
- mysql 01: source命令
- leetcode202---快乐数
- 应急科普|收好这份暑期安全指南,让孩子安全过暑假!
- Application engineering safety monitoring of wireless vibrating wire acquisition instrument
- 【力扣】1030.距离顺序排列矩阵单元格
- Tm1637 four digit LED display module Arduino driver with second dot
- Okaleido生态核心权益OKA,尽在聚变Mining模式
- Mongodb源码部署以及配置
- Oka pass rights and interests analysis is the best choice to participate in okaleido ecological construction
- 【力扣】645.错误的集合
猜你喜欢

Amd epyc 9664 flagship specification exposure: 96 core 192 threads 480MB cache 3.8ghz frequency

MXNet对DenseNet(稠密连接网络)的实现

Typora无法打开提示安装新版本解决办法

Leetcode1 -- sum of two numbers

Brush questions - Luogu -p1152 happy jump

Brush questions - Luogu -p1035 series summation

OKA通证权益解析,参与Okaleido生态建设的不二之选
![[directory blasting tool] information collection stage: robots.txt, Yujian, dirsearch, dirb, gobuster](/img/72/d3e46a820796a48b458cd2d0a18f8f.png)
[directory blasting tool] information collection stage: robots.txt, Yujian, dirsearch, dirb, gobuster

飞沃科技IPO过会:年营收11.3亿 湖南文旅与沅澧投资是股东

【力扣】1030.距离顺序排列矩阵单元格
随机推荐
CSV文本文件导入excel的四种方法
Lesson of C function without brackets
Practice of online problem feedback module (13): realize multi parameter paging query list
Mlops column introduction
[directory blasting tool] information collection stage: robots.txt, Yujian, dirsearch, dirb, gobuster
Day1:三种语言暴刷牛客130题
Introducing mlops interpretation (I)
苹果手机端同步不成功,退出登录,结果再也登录不了了
Leetcode1 -- sum of two numbers
埃拉托斯特尼筛法
Mxnet implementation of densenet (dense connection network)
Applet sharing function
实现一个家庭安防与环境监测系统(二)
飞沃科技IPO过会:年营收11.3亿 湖南文旅与沅澧投资是股东
NAT/NAPT地址转换(内外网通信)技术详解【华为eNSP】
命名空间与库
Xintang nuc980 set DHCP or static IP
Esp32 connects to Alibaba cloud mqtt IOT platform
Typora无法打开提示安装新版本解决办法
How happy is the frisbee bureau? 2022 youth trendy Sports Report