akanimax / pro_gan_pytorch

Unofficial PyTorch implementation of the paper titled "Progressive growing of GANs for improved Quality, Stability, and Variation"
MIT License
537 stars 99 forks source link

module must have its parameters and buffers on device cuda:0 (device_ids[0]) but found one of them on device: cpu #48

Closed AEP-WYK closed 2 years ago

AEP-WYK commented 4 years ago

when I run the "python generate_samples.py --generator_file "../checkpoint/GAN_GEN_SHADOW_8.pth" --latent_size 512"

akanimax commented 2 years ago

Are you trying to do generation of samples on the cpu? While you trained on the GPU. There is a quick fix for this with map_location argument of torch.load. More details here -> https://pytorch.org/docs/1.9.1/generated/torch.load.html.