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

Training on dsprites fails with 0-dim tensor #12

Open
rcnlee opened this issue Jul 26, 2019 · 4 comments
Open

Training on dsprites fails with 0-dim tensor #12

rcnlee opened this issue Jul 26, 2019 · 4 comments

Comments

@rcnlee
Copy link

rcnlee commented Jul 26, 2019

I'm running ./run_dsprites_B_gamma100_z10.sh with a reduced number of iterations.
Error is below:

=> no checkpoint found at 'checkpoints/dsprites_B_gamma100_z10/last'
 67%|██████████████████████████████████████████████████                         | 10000/15000.0 [34:22<16:59,  4.91it/s]Traceback (most recent call last):
  File "main.py", line 69, in <module>
    main(args)
  File "main.py", line 24, in main
    net.train()
  File "/Users/rlee18/git/Beta-VAE/solver.py", line 182, in train
    self.global_iter, recon_loss.data[0], total_kld.data[0], mean_kld.data[0]))
IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number
@Everbeast
Copy link

have you solved that problem?

@rcnlee
Copy link
Author

rcnlee commented Sep 24, 2019

No, I didn't solve it.

@lucasc896
Copy link

This should do it:

https://gist.github.com/lucasc896/017088d990980c43adec0af2dcb1c45c

@thavlik
Copy link

thavlik commented Oct 2, 2019

I can confirm the above changes remedy the problem. Thanks!

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

4 participants