wide-resnet.pytorch
wide-resnet.pytorch copied to clipboard
IndexError
Hi,
After following the install instructions, when I try and run main.py on CIFAR10, on the first epoch I get the following error:
Traceback (most recent call last): File "../main.py", line 220, in <module> train(epoch) File "../main.py", line 163, in train train_loss += loss.data[0] IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number
Any ideas?
Easy fix: replace loss.data[0] with loss.data.item()