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

invalid index of a 0-dim tensor #17

Closed
Jakexxh opened this issue May 14, 2019 · 3 comments
Closed

invalid index of a 0-dim tensor #17

Jakexxh opened this issue May 14, 2019 · 3 comments

Comments

@Jakexxh
Copy link

Jakexxh commented May 14, 2019

When I run the model with CUP, and got this error:

Traceback (most recent call last):
File "train.py", line 38, in
errors = model.get_current_errors()
File "/Users/XXX/Desktop/XXX/MC-GAN/models/cGAN_model.py", line 250, in get_current_errors
return OrderedDict([('G_GAN', self.loss_G_GAN.data[0]),
IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number`

Please change the code return OrderedDict([('G_GAN', self.loss_G_GAN.data[0]) in line 250 of cGAN_model.py into return OrderedDict([('G_GAN', self.loss_G_GAN.data)

@narusevic
Copy link

@Jakexxh Have you solved this issue?

@narusevic
Copy link

@Jakexxh Jakexxh closed this as completed May 21, 2020
@Jakexxh
Copy link
Author

Jakexxh commented May 21, 2020

Yes

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