当前位置:网站首页>CUDA out of memory 或 BrokenPipeError: [Errno 32] Broken pipe 或 OSError: [WinError 1455] 页面文件太小的解决办法
CUDA out of memory 或 BrokenPipeError: [Errno 32] Broken pipe 或 OSError: [WinError 1455] 页面文件太小的解决办法
2022-06-12 15:17:00 【Dreamcatcher风】
环境:
操作系统:Windows 10
内存:16G
显卡:3060(12G)
torch版本:1.10.2 + cuda11.3
torchvision版本:0.11.3 + cuda11.3
cuda版本:11.3 (英伟达官网安装的)
遇到的问题:
1)batch_size=2时正常训练,batch_size=4时,pycharm直接卡死闪退,重新打开后直接闪退,必须重启才行。或者就报错:Process finished with exit code -1073741819 (0xC0000005)。此时pycharm无法运行,只能重启电脑。
2)报错:CUDA out of memory,然而显存只占用了2G左右。
3)加载完模型后,一直卡在 开始训练 这里,显存占用一直处于0.6G。
原因和解决办法:
原因:实际上是 虚拟内存不足 的问题,只有当虚拟内存设置好了,显存就正常占用了。
解决办法:选择C盘,点“系统管理的大小”,重启电脑,解决。

注: DataLoader()里的 pin_memory和num_workers和这个问题无关,不过num_workers设置过大时,也会报错。
我的疑问??
为什么需要这么大的虚拟内存?在加载数据的时候,内存RAM也只占用了8G左右,但虚拟内存就占了18G左右,为什么不是先分配RAM,然后再分配虚拟内存呢?求解答。


边栏推荐
- Notes on ARM 64 instructions
- Function recursion example
- Qiming cloud sharing | demonstrate the switch through an example of the matter protocol to control the light on and off through the matter protocol
- C main function
- POSTMAN-REST Client插件的应用
- Introduction to microservices
- New features of ES6
- ROS初学者编写小乌龟以一定速度旋转一定角度的server
- Kinect2.0+ORBSLAM2_with_pointcloud_map
- Leetcode daily question - fair candy bar exchange
猜你喜欢

Pta: self test -2 prime pair conjecture (20 points)

POSTMAN-REST Client插件的应用

TCP与UDP的区别,以及TCP的三次握手和TCP的四次挥手

Qiming cloud sharing | demonstrate the switch through an example of the matter protocol to control the light on and off through the matter protocol
![[jvm learning] class loading subsystem](/img/60/e863495ce4ea5826d1404a73c90033.jpg)
[jvm learning] class loading subsystem

Qiming Zhixian shares the application scheme of 2.8-inch handheld central control screen

How to set public IP access on the H3C gr5200 router

Deepin20.6 RTX3080 安裝顯卡驅動510.60.02、CUDA11.6、PyTorch1.11

h3c GR5200路由器上如何设置公网ip可以访问

ROS beginners write the server that the little turtle rotates a certain angle at a certain speed
随机推荐
Scala下载及IDEA安装Scala插件(保姆级教程超详细)
C main函数
[untitled]
#include使用“文件名“和<文件名>引入头文件的区别及简述
[LDA] LDA theme model notes - mainly Dirichlet
NETCORE combined with cap event bus to realize distributed transaction -- Introduction (1)
How to write year-end summary
C语言打开中文路径文件
Selenium advanced
Industrial end: a new battlefield of 618
Leetcode daily question - fair candy bar exchange
PTA:自测-3 数组元素循环右移问题 (20分)
[jvm learning] types of GC and allocation process of objects on JVM heap
Pta: self test -2 prime pair conjecture (20 points)
[spark][core] interview questions talk about push based shuffle
Open Chinese path file in C language
Servlet connects to database to realize user login function
[jvm learning] local method stack and heap
Notes on ARM 64 instructions
USART(RS232422485)、I2C、SPI、CAN、USB总线