bearpaw / pytorch-classification

Classification with PyTorch.
MIT License
1.68k stars 562 forks source link

running with a newer pytorch version #33

Open chenhuims opened 5 years ago

chenhuims commented 5 years ago

Hi, I hit the following error when I run cifar.py with pytorch 1.0.1.post2.

IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number

This is due to a pytorch version greater hthan 0.5 is used as reported here. I've posted a fix here in case other people encounter the same issue.

bearpaw commented 5 years ago

Thanks. Would you be able to create a PR?