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

torch runtimerror

Open MarcelloPajntar97 opened this issue 3 years ago • 6 comments

hi @lucidrains i've a issue when try to train with image with size of 512. Run the following line: stylegan2_pytorch --data ./flowers --multi-gpus --image-size 512 Issue: Screenshot 12_6_2020 2_48_58 PM

Maybe i have to set additional parameters. if yes what have i to set? Thanks

MarcelloPajntar97 avatar Dec 06 '20 13:12 MarcelloPajntar97

Hi Marcello!

Can you check to make sure you aren't running out of memory?

lucidrains avatar Dec 06 '20 17:12 lucidrains

@MarcelloPajntar97 Try setting your batch size lower and your gradient-accumulate-every higher

lucidrains avatar Dec 06 '20 17:12 lucidrains

@MarcelloPajntar97 most people don't have the resources to train 512x512 and beyond, but you can try https://github.com/lucidrains/lightweight-gan to trade off quality for less resources!

lucidrains avatar Dec 06 '20 19:12 lucidrains

@lucidrains when i run the command CUDA report me that i haven't enough free space to complete the operation, but i tried to clear it by the following: torch.cuda.empty_cache() but it didn't resolve the issue. If i decrease the batch size to 1 the train works but the results don't seem to be satisfactory that's why I've now stopped the training and started another with image size 256

MarcelloPajntar97 avatar Dec 06 '20 19:12 MarcelloPajntar97

Thanks a lot for the help, in the next few days I will look at the github link you sent :)

MarcelloPajntar97 avatar Dec 06 '20 19:12 MarcelloPajntar97

Yea, most people can't afford 512 or 1024, but as graphics card get more powerful, I'm sure those will be 'unlocked' in due time

lucidrains avatar Dec 06 '20 19:12 lucidrains