当前位置:网站首页>RuntimeError: CUDA out of memory. Tried to allocate 32.00 MIB | view GPU memory
RuntimeError: CUDA out of memory. Tried to allocate 32.00 MIB | view GPU memory
2022-07-21 17:34:00 【Claire_ Shang】
RuntimeError: CUDA out of memory. Tried to allocate 32.00 MiB (GPU 0; 6.00 GiB total capacity; 4.40 GiB already allocated; 0 bytes free; 4.43 GiB reserved in total by PyTorch)
Traceback (most recent call last):
File "D:/Papers to read/2022.07/DeamNet-main/DeamNet-main/train.py", line 170, in <module>
train(epoch)
File "D:/Papers to read/2022.07/DeamNet-main/DeamNet-main/train.py", line 73, in train
prediction = model(input)
................
File "D:\ProgramData\Anaconda3\envs\python36\lib\site-packages\torch\nn\functional.py", line 1136, in relu
result = torch.relu(input)
RuntimeError: CUDA out of memory. Tried to allocate 32.00 MiB (GPU 0; 6.00 GiB total capacity; 4.40 GiB already allocated; 0 bytes free; 4.43 GiB reserved in total by PyTorch)
Process finished with exit code 1
Method found
1. Check the computer GPU Memory stay cmd The input :
nvidia-smi.exe -h
And then you type in
nvidia-smi.exe -i 0
You can see the running memory of the computer ,
About the found call GPU Methods , The source code contains , So it's not the problem
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "0,1"
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") # modify : Add this trip . Judge CUDA Can I use , Can not be used CPU
2. Another way is to modify batchsize
batchsize Turned out to be 8, Change it to 1, It's ready to run
parser.add_argument('--batchSize', type=int, default=1, help='training batch size')
边栏推荐
猜你喜欢
随机推荐
Analysis of tars source code 27
如何将服务器上的文件_按自定义的层级关系_进行压缩并下载
竣达技术丨MOBUS 转SNMP网络监控终端
C#(三十四)之坐标变换
Huawei wireless devices are configured with ACL based message filtering
同城多数据中心部署 TiDB
Analysis of tars source code 21
What does it operation and maintenance management mean? How to establish an effective IT operation and maintenance management system?
JMeter regular, XPath, JSON
华为无线设备配置不同业务VLAN的AP间快速漫游
cv demo
How to transfer files on the server_ By customized hierarchical relationship_ Compress and download
[基础架构] [Flink] Flink/Flink-CDC代码实现业务接入
JS array
openresty ngx.ctx请求上下文
OutOfMemoryError 内存溢出问题排查
两地三中心部署
C#(四十三)之线程Mutex互斥
最全最新方法:Electron开发中设置a标签的href跳转默认浏览器打开链接
Swift 中风味各异的依赖注入