显存不足问题(OOM、RuntimeError: CUDA out of memory)

显存不足问题(OOM、RuntimeError: CUDA out of memory)。

记录一次pytorch yolov3爆显存(windows使用任务管理器查看显存为4G)。在这里插入图片描述

2G显存:SSD、YOLOV4-TINY
4G显存:YOLOV3
6G显存:YOLOV4、Retinanet、M2det、Efficientdet、Faster RCNN等
8G+显存:随便选吧。
解决方法:减小batch_size,需要注意的是,受到BatchNorm2d影响,batch_size不可为1,至少为2。

问:为什么提示 RuntimeError: CUDA out of memory. Tried to allocate 52.00 MiB (GPU 0; 15.90 GiB total capacity; 14.85 GiB already allocated; 51.88 MiB free; 15.07 GiB reserved in total by PyTorch)?
答:这是pytorch中出现的,爆显存了,同上。

 # 相关代码仓库可以参考下表所示

相关仓库

模型路径
YoloV3https://github.com/bubbliiiing/yolo3-pytorch
Efficientnet-Yolo3https://github.com/bubbliiiing/efficientnet-yolo3-pytorch
YoloV4https://github.com/bubbliiiing/yolov4-pytorch
YoloV4-tinyhttps://github.com/bubbliiiing/yolov4-tiny-pytorch
Mobilenet-Yolov4https://github.com/bubbliiiing/mobilenet-yolov4-pytorch
YoloV5https://github.com/bubbliiiing/yolov5-pytorch
YoloXhttps://github.com/bubbliiiing/yolox-pytorch
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Sun_Raiser

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值