Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to start training?? #18

Open
edwardcho opened this issue May 11, 2020 · 1 comment
Open

How to start training?? #18

edwardcho opened this issue May 11, 2020 · 1 comment

Comments

@edwardcho
Copy link

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..

@CorvoOrc
Copy link

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())))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants