aitorzip / PyTorch-CycleGAN

A clean and readable Pytorch implementation of CycleGAN
https://arxiv.org/abs/1703.10593
GNU General Public License v3.0
1.19k stars 283 forks source link

How to use multiple GPUs to train cycleGAN ? #7

Open MrLinNing opened 5 years ago

lg920810 commented 5 years ago

I have the same problem. Have you solved it?

zhangluustb commented 4 years ago

if torch.cuda.device_count() > 1: print("Let's use", torch.cuda.device_count(), "GPUs!") netG_A2B = torch.nn.DataParallel(netG_A2B) netG_B2A = torch.nn.DataParallel(netG_B2A) netD_A = torch.nn.DataParallel(netD_A) netD_B = torch.nn.DataParallel(netD_B) if opt.cuda: netG_A2B.cuda() netG_B2A.cuda() netD_A.cuda() netD_B.cuda()