show epoch progress correctly

This commit is contained in:
Edgar Riba 2017-03-07 18:44:03 +01:00 committed by GitHub
parent 492c38def2
commit c0f267c6f0
1 changed files with 2 additions and 2 deletions

View File

@ -214,8 +214,8 @@ for epoch in range(opt.niter):
optimizerG.step() optimizerG.step()
gen_iterations += 1 gen_iterations += 1
print('[%d/%d][%d/%d] Loss_D: %f Loss_G: %f Loss_D_real: %f Loss_D_fake %f' print('[%d/%d][%d/%d][%d] Loss_D: %f Loss_G: %f Loss_D_real: %f Loss_D_fake %f'
% (epoch, opt.niter, gen_iterations, len(dataloader), % (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:
vutils.save_image(real_cpu, '{0}/real_samples.png'.format(opt.experiment)) vutils.save_image(real_cpu, '{0}/real_samples.png'.format(opt.experiment))