当前位置:网站首页>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,然后再分配虚拟内存呢?求解答。


边栏推荐
猜你喜欢

Scala下载及IDEA安装Scala插件(保姆级教程超详细)

Ngork implements intranet penetration -- free

3D reconstruction system | L3 incremental motion recovery structure (incremental SFM)

Idea大全(转载)

ngork实现内网穿透--免费

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

Assertion of selenium webdriver

2021-06-20

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

IMU的学习记录
随机推荐
Phpstudy indicates that the hosts file may not exist or be blocked from being opened. How to resolve the failure of synchronizing hosts
【无标题】
Swap numbers, XOR, operator correlation
Xshell 7 official website free download
关于互联网大厂裁员
idea 拉取分支代码
How to write year-end summary
Singleton mode instance
[jvm learning] parental delegation mechanism and PC register (program counter)
[jvm learning] local method stack and heap
Pta: self test -2 prime pair conjecture (20 points)
Ngork implements intranet penetration -- free
FIRSTVT and LASTVT vernacular
ES6新特性
C scanf function
如何写年终总结
Scala download and idea installation of scala plug-ins (nanny level tutorial is super detailed)
Rust tip - running the tensorrt model through FFI programming
New features of ES6
Servlet知识详解(2)