quark0 / darts

Differentiable architecture search for convolutional and recurrent networks
https://arxiv.org/abs/1806.09055
Apache License 2.0
3.92k stars 843 forks source link

Getting Index Error #144

Open shashi19081994 opened 4 years ago

shashi19081994 commented 4 years ago

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