I want to run some experiments on my GPU device, but I get this error:
RuntimeError: CUDA out of memory. Tried to allocate 3.63 GiB (GPU 0; 15.90 GiB total capacity; 13.65 GiB already allocated; 1.57 GiB free; 13.68 GiB reserved in total by PyTorch)
I read about possible solutions here, and the common solution is this:
It is because of mini-batch of data does not fit onto GPU memory. Just decrease the batch size. When I set batch size = 256 for cifar10 dataset I got the same error; Then I set the batch size = 128, it is solved.
But in my case, it is a research project, and I want to have specific hyper-parameters and I can not reduce anything such as batch size.
Does anyone have a solution for this?