RuntimeError: CUDA error: out of memoryCUDA

就是当网络参数什么都没有问题了,而且batch_size已经是最小了,还是出现以了问题

但据我遇到的RuntimeError: CUDA error: out of memoryCUDA,其实有两种,

第一种就是如下

RuntimeError: CUDA out of memory. Tried to allocate 338.00 MiB (GPU 0; 2.00 GiB total capacity; 842.86 MiB already allocated; 215.67 MiB free; 848.00 MiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

这种就是属于我选择冻结训练所导致的,就还是我电脑显卡内存不够,我就把冻结训练取消掉了,就遇到了

第二种:

RuntimeError: CUDA error: out of memory
CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.

第二种就是显存不够了,那我搜索了了一圈,觉得最实在的就是

使用学校提供的服务器

选择一个更好的显卡

等你有了服务器,或者一个好的显卡,就会减少很多的烦恼

评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值