Open shashi19081994 opened 4 years ago
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.
@quark0 Sir, IndexError: invalid index of a 0-dim tensor. Use
tensor.item()
in Python ortensor.item<T>()
in C++ to convert a 0-dim tensor to a numberI 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
Thank you in Advance.