usuyama / pytorch-unet

Simple PyTorch implementations of U-Net/FullyConvNet (FCN) for image segmentation
https://colab.research.google.com/github/usuyama/pytorch-unet/blob/master/pytorch_unet_resnet18_colab.ipynb
MIT License
827 stars 233 forks source link

CUDA out of memory #18

Open zhibaishouheilab opened 1 year ago

zhibaishouheilab commented 1 year ago

Hello! Thanks for your excellent work! I'm just learning the pytorch and unet network. When I ran your scripts I got the following error: OutOfMemoryError: CUDA out of memory. Tried to allocate 226.00 MiB (GPU 0; 4.00 GiB total capacity; 3.24 GiB already allocated; 0 bytes free; 3.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 The error was got in the step of training. And there were no other process hobbling the gpu. Thanks for your reply.

shahzad-ali commented 1 year ago

The provided information is too generic. It simply means your GPU memory is low and cannot fit the model and its parameters during the training process. You may try

(ordered list)

Good luck!

aymuos15 commented 5 months ago

https://github.com/usuyama/pytorch-unet/pull/19