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

Getting Index Error #144

Open
shashi19081994 opened this issue Jun 19, 2020 · 1 comment
Open

Getting Index Error #144

shashi19081994 opened this issue Jun 19, 2020 · 1 comment

Comments

@shashi19081994
Copy link

@quark0 Sir,
IndexError: invalid index of a 0-dim tensor. Use tensor.item() in Python or tensor.item<T>() in C++ to convert a 0-dim tensor to a number

I am getting the above error when i try to run the following command " cd cnn && python test.py --auxiliary --model_path cifar10_model.pt" for cifar 10
Error 1

Thank you in Advance.

@DominickZhang
Copy link

The index error occurs in PyTorch >= 0.5. You could replace loss.data[0] by loss.data and all other related areas, or downgrade the PyTorch version. For more information about this error, you could refer to this link.

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