open-mmlab / mmdetection

OpenMMLab Detection Toolbox and Benchmark
https://mmdetection.readthedocs.io
Apache License 2.0
29.24k stars 9.41k forks source link

get_flops.py "RuntimeError: CUDA error: out of memory"? #11830

Open DaiY123 opened 3 months ago

DaiY123 commented 3 months ago

I encountered the error "RuntimeError: CUDA error: out of memory" when running get_flops today.

All the code follows the procedure outlined at https://mmdetection.readthedocs.io/zh-cn/latest/get_started.html. I have used get_flops.py before without encountering this error. Moreover, my training process is running normally.

My training command is

python tools/train.py configs/sparse rcnn/sparse-rcnn_r50_fpn_lx_coco.py

. The command I used for get_flops.py is python tools/analysis tools/get flops.py configs/sparse rcnn/sparse-rcnn_r50_fpn_lx_coco.py. I have tried adjusting batch size and proposals, but neither worked.

image

DaiY123 commented 3 months ago

PyTorch 2.0.0 Python 3.8(ubuntu20.04) Cuda 11.8 GPU V100-32GB(32GB)