Skip to content
Snippets Groups Projects

Resolve "Add GANs"

Merged Guillaume HEUSCH requested to merge 4-add-gans into master
1 file
+ 4
2
Compare changes
  • Side-by-side
  • Inline
@@ -194,9 +194,11 @@ class ConditionalGANTrainer(object):
@@ -194,9 +194,11 @@ class ConditionalGANTrainer(object):
# tried to move tensors, variables on the GPU -> does not work
# tried to move tensors, variables on the GPU -> does not work
# let the tensors on the CPU -> does not work
# let the tensors on the CPU -> does not work
# => model has to be brought back to the CPU :/
# => model has to be brought back to the CPU :/
self.netG = self.netG.cpu()
if self.use_gpu:
 
self.netG = self.netG.cpu()
fake_examples = self.netG(self.fixed_noise, self.fixed_one_hot)
fake_examples = self.netG(self.fixed_noise, self.fixed_one_hot)
self.netG = self.netG.cuda()
if self.use_gpu:
 
self.netG = self.netG.cuda()
vutils.save_image(fake_examples.data, '%s/fake_samples_epoch_%03d.png' % (output_dir, epoch), normalize=True)
vutils.save_image(fake_examples.data, '%s/fake_samples_epoch_%03d.png' % (output_dir, epoch), normalize=True)
# do checkpointing
# do checkpointing
Loading