de-normalize images for displaying
sorry, the previous pull request inserting real_cpu in the wrong place
This commit is contained in:
parent
e05cae9275
commit
8ab2d26efe
2
main.py
2
main.py
|
@ -218,8 +218,10 @@ for epoch in range(opt.niter):
|
||||||
% (epoch, opt.niter, i, len(dataloader), gen_iterations,
|
% (epoch, opt.niter, i, len(dataloader), gen_iterations,
|
||||||
errD.data[0], errG.data[0], errD_real.data[0], errD_fake.data[0]))
|
errD.data[0], errG.data[0], errD_real.data[0], errD_fake.data[0]))
|
||||||
if gen_iterations % 500 == 0:
|
if gen_iterations % 500 == 0:
|
||||||
|
real_cpu = real_cpu.mul(0.5).add(0.5)
|
||||||
vutils.save_image(real_cpu, '{0}/real_samples.png'.format(opt.experiment))
|
vutils.save_image(real_cpu, '{0}/real_samples.png'.format(opt.experiment))
|
||||||
fake = netG(Variable(fixed_noise, volatile=True))
|
fake = netG(Variable(fixed_noise, volatile=True))
|
||||||
|
fake.data = fake.data.mul(0.5).add(0.5)
|
||||||
vutils.save_image(fake.data, '{0}/fake_samples_{1}.png'.format(opt.experiment, gen_iterations))
|
vutils.save_image(fake.data, '{0}/fake_samples_{1}.png'.format(opt.experiment, gen_iterations))
|
||||||
|
|
||||||
# do checkpointing
|
# do checkpointing
|
||||||
|
|
Loading…
Reference in New Issue