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


边栏推荐
猜你喜欢

Solve log4j2 vulnerability and be attacked by mining and zombie process viruses

PTA:自测-3 数组元素循环右移问题 (20分)

Left aligned, right aligned, random number, goto, compare output bool

Xshell 7 official website free download

C main function

Microservice fault tolerance

POSTMAN-REST Client插件的应用

xshell 7 官网免费下载

TC menu split

TCP与UDP的区别,以及TCP的三次握手和TCP的四次挥手
随机推荐
Change according to the situation, the road to promotion in the second half of 2022
[game server design cases] insights
阿里、腾讯、拼多多垂范,产业互联网的新逻辑渐显
[jvm learning] local method stack and heap
安装PS软件时提示程序无法访问关键文件/目录,错误代码:41的解决方法
C data type
Xshell 7 official website free download
C 字符串
TCP与UDP的区别,以及TCP的三次握手和TCP的四次挥手
Rust tip - running the tensorrt model through FFI programming
Idea pull branch code
Error 1105: message:\“raft entry is too large
ROS beginners write the server that the little turtle rotates a certain angle at a certain speed
Module yaml error: Unexpected key in data: static_ context [line 9 col 3]
Idea大全(转载)
How to set public IP access on the H3C gr5200 router
Assertion of selenium webdriver
3D reconstruction system | L3 incremental motion recovery structure (incremental SFM)
ngork实现内网穿透--免费
C常量,不能改变