当前位置:网站首页>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
边栏推荐
- 苹果手机端同步不成功,退出登录,结果再也登录不了
- Sunfeng, general manager of Yixun: the company has completed the share reform and is preparing for IPO
- Goldfish rhca memoirs: cl210 managing storage -- managing shared file systems
- Esp32 connects to Alibaba cloud mqtt IOT platform
- [configure hifive1 revb] the device manager does not recognize the port, and can not connect to j-link via USB
- 金鱼哥RHCA回忆录:CL210管理存储--管理共享文件系统
- CDA level Ⅰ 2021 new version simulation question 2 (with answers)
- Digital Twins - cognition
- Write an esp32 Watchdog with Arduino
- Redux usage and analysis
猜你喜欢

伯克利博士『机器学习工程』大实话;AI副总裁『2022 ML就业市场』分析;半导体创业公司大列表;大规模视频人脸属性数据集;前沿论文 | ShowMeAI资讯日报

Brush questions - Luogu -p1161 turn on the light

Brush questions - Luogu -p1047 trees outside the school gate

【力扣】1030.距离顺序排列矩阵单元格

Pytest.mark.parameterize and mock use

Internal error of LabVIEW

Redux usage and analysis

Oka pass rights and interests analysis is the best choice to participate in okaleido ecological construction

2271. Maximum number of white bricks covered by blanket ●●

Applet enterprise red envelope function
随机推荐
What are the ranking strategies for mobile websites, independent apps and websites?
Mongodb source code deployment and configuration
What problems should SEOER pay attention to when baidu searches and attacks pirated websites?
[force buckle] 645. Wrong set
Setting of parameter configuration tool for wireless vibrating wire collector
Xintang nuc980 set DHCP or static IP
依迅总经理孙峰:公司已完成股改,准备IPO
Framework package merge script
Mxnet implementation of densenet (dense connection network)
The practice of depth estimation self-monitoring model monodepth2 in its own data set -- single card / multi card training, reasoning, onnx transformation and quantitative index evaluation
Mongodb源码部署以及配置
[force deduction] 1030. Arrange matrix cells in distance order
[configure hifive1 revb] the device manager does not recognize the port, and can not connect to j-link via USB
【力扣】1030.距离顺序排列矩阵单元格
What financial products can I invest with some money in my hand?
Brush questions - Luogu -p1151 sub number integer
Detailed explanation of nat/napt address translation (internal and external network communication) technology [Huawei ENSP]
[original] nine point calibration tool for robot head camera calibration
Introducing mlops interpretation (I)
Internal error of LabVIEW