Closed hinofafa closed 5 years ago
For remarks:
item()
-> data[0]
self.to_np
-> .data.cpu().numpy()
(How torch tensor to numpy)display_vars
-> images.size()
Temporarily, below codes are commented.
info['fixed_fake_images'] = self.to_np(denorm(real_images.data).view(*display_vars)[:10, :, :, :])
For https://github.com/hinofafa/Self-Attention-GAN/issues/1#issuecomment-462315109, the code has uncommented by fixing the code at commit cf99d8bc4307168e8f05188474c1875441c4fd33
Tensorboard feature has inserted to the repository.
add a tensorboard logging to the train.py by inserting the following code at line 180. This needs to be modified because l4 does not exist if imsize is less than 64 and the network fails if imsize is greater than 64. When the larger imsize is fixed I will issue a pull request. Also build_tensorboard should be changed. Hope this helps!
Insert at line 180 in train.py
Print out log info
if (step + 1) % self.log_step == 0: elapsed = time.time() - start_time elapsed = str(datetime.timedelta(seconds=elapsed)) print("Elapsed [{}], G_step [{}/{}], D_step[{}/{}], d_out_real: {:.4f}, " " ave_gamma_l3: {:.4f}, ave_gamma_l4: {:.4f}". format(elapsed, step + 1, self.total_step, (step + 1), self.total_step, d_loss_real.item(), self.G.attn1.gamma.mean().item(), self.G.attn2.gamma.mean().item()))