I found this problem running a neural network on Colab Pro+ (with the high RAM option).
RuntimeError: CUDA out of memory. Tried to allocate 8.00 GiB (GPU 0; 15.90 GiB total capacity; 12.04 GiB already allocated; 2.72 GiB free; 12.27 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF
I have already decreased the batch size to 2. I upload the data using the h5py
format.
At this point, I assume the only thing I can try is setting the max_split_size_mb
.
I could not find anything about how I can implement the max_split_size_mb
. The PyTorch documentation was not clear to me.