HHTseng / video-classification

Tutorial for video classification/ action recognition using 3D CNN/ CNN+RNN on UCF101
941 stars 216 forks source link

RuntimeError: CUDA out of memory #27

Open Sei2112 opened 4 years ago

Sei2112 commented 4 years ago

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.

MounirB commented 4 years ago

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

Sei2112 commented 4 years ago

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)

MounirB commented 4 years ago

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

berna-ylmz commented 3 years ago

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