video-classification icon indicating copy to clipboard operation
video-classification copied to clipboard

RuntimeError: CUDA out of memory

Open Sei2112 opened this issue 4 years ago • 4 comments

hello there! I was running the UCF101_3DCNN.py in pycharm, and this issue showed up: RuntimeError: CUDA out of memory. Tried to allocate 1.19 GiB (GPU 0; 6.00 GiB total capacity; 3.60 GiB already allocated; 738.91 MiB free; 3.60 GiB reserved in total by PyTorch) I changed the batch size to 1 and it disappeared. but I guess it is not a proper way to solve the problem. hope someone could offer some suggestion.

Sei2112 avatar May 16 '20 03:05 Sei2112

What kind of GPU do you have ? Did you try to reduce the image size and make it square (height=weight) ?

MounirB avatar May 16 '20 08:05 MounirB

What kind of GPU do you have ? Did you try to reduce the image size and make it square (height=weight) ?

thanks for your help! I reduced the images to 128*128, now I can set batch size to 16 (if higher than 16 it still goes wrong)

Sei2112 avatar May 17 '20 03:05 Sei2112

It depends on your GPU and the C3D implementation. How many parameters are you training ?

MounirB avatar May 18 '20 12:05 MounirB

I have same problem @MounirB . I use my own dataset and set begin_frame = 1,end_frame = 500,size = 256,342,number of classes = 5. But occur cuda out memory. How can I overcome this problem? Thanks

berna-ylmz avatar Jan 05 '21 19:01 berna-ylmz