stylegan2-pytorch icon indicating copy to clipboard operation
stylegan2-pytorch copied to clipboard

Out of memory when generating

Open BabaVegato opened this issue 4 years ago • 2 comments

Hello, I'm trying to generate from an 18x512 latent vector, with the code : image, latent = net.decoder([codes], input_is_latent=True) but when I do it I get this error : CUDA out of memory. Tried to allocate 294.00 MiB (GPU 0; 15.90 GiB total capacity; 14.58 GiB already allocated; 259.75 MiB free; 14.77 GiB reserved in total by PyTorch) I don't know what I did wrong...

BabaVegato avatar May 07 '21 22:05 BabaVegato

Using torch.no_grad will reduce the memory consumption.

rosinality avatar May 08 '21 00:05 rosinality

Thanks a lot !

BabaVegato avatar May 10 '21 11:05 BabaVegato