mmdetection训练VOC数据集时遇到RuntimeError: CUDA out of memory.
来源:7-9 MMdetection训练Passcal VOC目标检测任务(下)

Sens_bjbn
2021-01-30
老师,mmdetection训练VOC数据集时遇到:
RuntimeError: CUDA out of memory. Tried to allocate 68.00 MiB (GPU 0; 5.81 GiB total capacity; 4.44 GiB already allocated; 55.00 MiB free; 4.72 GiB reserved in total by PyTorch)
但是,我的nvidia-smi查看GPU占用不多,如下:
±----------------------------------------------------------------------------+
| NVIDIA-SMI 460.32.03 Driver Version: 460.32.03 CUDA Version: 11.2 |
|-------------------------------±---------------------±---------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=++==============|
| 0 GeForce GTX 166… Off | 00000000:01:00.0 Off | N/A |
| N/A 41C P8 5W / N/A | 268MiB / 5944MiB | 3% Default |
| | | N/A |
±------------------------------±---------------------±---------------------+
网上都说改batch_size,我找不到在哪,请问老师怎么解决?(黔驴技穷,心态已崩)
1回答
-
会写代码的好厨师
2021-02-04
类似这个文件中的
imgs_per_gpu=2, #每个gpu的图像的数目,类似于每个gpu的batchsize
workers_per_gpu=2, #每个gpu的线程数目把2调成1,另外,里面有一个参数inage scale 也就是图片的大小,也可以调小一些
00
相似问题