PyTorch Can’t Allocate More Memory

Here’s a solution to your biggest Deep Learning woe

Abhishek Verma

--

Photo by Fredy Jacob on Unsplash

We all love PyTorch for many obvious reasons (i.e. ease of implementing our ideas). But, sometimes you run into an error:

CUDA out of memory. Tried to allocate 20.00 MiB (GPU 0; 15.90 GiB total capacity; 15.17 GiB already allocated; 15.88 MiB free; 15.18 GiB reserved in total by PyTorch)

--

--