Cuda out of memory

Hi all,

Appreciate any help in deciphering this:
RuntimeError: CUDA out of memory. Tried to allocate 1.07 GiB (GPU 0; 6.00 GiB total capacity; 89.04 MiB already allocated; 4.54 GiB free; 338.00 KiB cached)

This is for a small dataset, small batch size.

According to the error I shouldn’t be out of memory right? 4.54GB free and 1.07GB was tried to be allocated?

Did you ever solve this problem? I am encountering the exact same error. I have tried restarting the kernel. tried to use torch.cuda.empty_cache() and gc.collect() to clear the GPU, but I’m still running into problems. I’m getting the following when running the lesson3-planet notebook directly:

Its been a couple of months since the original post and haven’t had an issues since. I am assuming you have played around with batch size and image size? Also what architecture are you using, try using a smaller architecture and see if it now works. Sometimes I’ve had multiple notebooks open and closing those has helped.