YOLOv3_PyTorch icon indicating copy to clipboard operation
YOLOv3_PyTorch copied to clipboard

CUDA out of memory, any tips?

Open ghost opened this issue 5 years ago • 3 comments

I've gotten image recognition to work at multiple frames/second, using a GTX 1060 with 6GB of memory. Now I'm trying to train a custom classifier but I keep running out of memory. Running on the darknet implementation, I can train using the yolov3-tiny.cfg file but not the yolov3.cfg file, which I guess is probably expected behavior given my hardware limitations. Now I'm trying to train with this implementation.

What parameters could I tweak in training/params.py to reduce my memory consumption? Is there an equivalent param in this implementation for subdivisions in the darknet implementation?

ghost avatar Feb 21 '19 23:02 ghost

I think you should turn down batch_size. You can set batch_size equal 1 at first and turn up it slowly.From experience,batch_size equals 6 maybe the best for GTX 1060 when img_h and img_h equals 416.

guagen avatar Mar 06 '19 13:03 guagen

In my experience, batch size should be set to be 16 if your GPU memory is 12G (GTX1080Ti).

AndrewZhuZJU avatar Apr 17 '19 03:04 AndrewZhuZJU

remove the parallels config in params.py and related code in main.py

leonardozcm avatar Nov 10 '20 07:11 leonardozcm