DiscoGAN-pytorch
DiscoGAN-pytorch copied to clipboard
How to start training??
Hello Sir,
I downloaded your code and maps-dataset.. And when I started I met some error.
...
Traceback (most recent call last):
File "main.py", line 41, in <module>
main(config)
File "main.py", line 33, in main
trainer.train()
File "/itsme/TESTBOARD/additional_networks/GAN/pytorch_DiscoGAN_carpedm20/trainer.py", line 247, in train
format(step, self.max_step, l_d.data[0], l_g.data[0]))
IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number
Thanks..
You need to change from .data[0] to .item() (example: print("[{}/{}] Loss_D: {:.4f} Loss_G: {:.4f}".format(step, self.max_step, l_d.data.item(), l_g.data.item())))