Hello,
I am pretty new to machine learning and I am facing an issue I cannot solve by myself.
I took this code to implement U-net model and modify it a little bit to fit my dataset: https://www.kaggle.com/hsankesara/unet-image-segmentation 33
I have 240 pairs of images-masks both 256x256 px size.
My batch size is reduce to 8 but I have the error “CUDA out of memory. Tried to allocate 408.00 MiB (GPU 0;5.00 GiB total capacity; 3.00 GiB already allocated; 236.37 MiB free; 3.46 GiB reserved in total by PyTorch)”.
The error happens at the epoch 49/1000 in the middle of the forward function of the Unet class.
From suggestions to same issue topics, I have tried to del some variables and use torch.cuda.empty_cache() after each iterations, I have also tried to use torch.no.grad() to get the validation loss.
Those did not help, but it is possible that I did not put them in the right place.
From the linked code, is it possible to have at least advice to where I should empty the cache, delete the variables etc ?
Or if you have other hypothesis to solve this issue of memory ?
Thank you for the help !
Paule.