Open jaewoogwak opened 6 months ago
I found some error
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
tensor.item()
tensor.item<T>()
Then I changed,
In train function,
loss.data.item() # loss.data[0] -> loss.data.item()
In test function,
test_loss += F.nll_loss(output, target, size_average=False).item() # .data[0] -> .item()
It works well
I found some error
Then I changed,
In train function,
In test function,
It works well