hyperseg icon indicating copy to clipboard operation
hyperseg copied to clipboard

CUDA out of memory

Open hhboy98 opened this issue 3 years ago • 6 comments

Thank you for your sharing. Why do I break out CUDA out of memory every time in a fixed training stage

hhboy98 avatar Jul 14 '21 05:07 hhboy98

@hhboy98 , I also meet this problem. Have you solved it?

vcjmhg avatar Aug 01 '21 02:08 vcjmhg

Try to reduce the batch size.

YuvalNirkin avatar Aug 03 '21 07:08 YuvalNirkin

ok, thank u!

vcjmhg avatar Aug 03 '21 08:08 vcjmhg

Hi,a new problem has appeared again, even though I set the batch_size to 1, it still out of memory. image

leo-hao avatar Sep 25 '21 08:09 leo-hao

It seems like your GPU does not have enough memory (10GB) for running the training even with batch_size set to 1. In the configuration you have attempted to run the training resolution is 1024x512 this is quite a large resolution, you can try reducing it to 512x256 and you should still get reasonable results. Alternatively you try training a smaller model, for example using the the B0 backbone instead of the B1 backbone.

YuvalNirkin avatar Sep 26 '21 14:09 YuvalNirkin

Dear doctor Nirkin, I know where I am wrong, I need to modify the batch-size in /config/train/cityscapes_efficientnet_b1_hyperseg-m.py, instead of writing --batch-size 1 in the terminal.
With the help of your tips, I finally started my training successfully. Sincerely thank you for your patience and help. Wish you a happy life and smooth work.

leo-hao avatar Sep 26 '21 15:09 leo-hao