YuvalNirkin / fsgan

FSGAN - Official PyTorch Implementation
https://nirkin.com/fsgan
Creative Commons Zero v1.0 Universal
754 stars 147 forks source link

CUDA out of memory error #125

Closed Nesggy closed 3 years ago

Nesggy commented 3 years ago

Hello, I have this problem, and I've searched for a solution without success. Some people said to reduce batch size, I've done it and I still the same error. Others suggest to run this: torch.cuda.empty_cache() but I don't know how to run this command. I only have 600Mb free, how can I increase it? This is my error every time I execute swap.py or reenact.py. After this step => Computing face segmentation for video: I get this error: RuntimeError: CUDA out of memory. Tried to allocate 1024.00 MiB (GPU 0; 8.00 GiB total capacity; 4.41 GiB already allocated; 615.77 MiB free; 5.48 GiB reserved in total by PyTorch)

tushar-31093 commented 3 years ago

Why close this?

Nesggy commented 3 years ago

because trying to reduce the batch size solved by problem

tushar-31093 commented 3 years ago

Any clue on how to resolve this? error

tushar-31093 commented 3 years ago

Windows 10, Conda, Pytorch with CUDA, Batch size 1, Test image to target video

Nesggy commented 3 years ago

I added -db 1 -pb 1 -lb 1 -sb 1 at the end of the command

tushar-31093 commented 3 years ago

Well, The above code is followed by this error now.

error2

Nesggy commented 3 years ago

I think that's because you only have 4gb VRAM. I have 8gb VRAM, and it's recommended to have 11gb I think

nonlin commented 2 years ago

I have 11 with a 2080ti and still get this? What is the solution?