When I use y_train.unsqueeze_(1), I am still getting same error:
RuntimeError: multi-target not supported at /Users/soumith/code/builder/wheel/pytorch-src/aten/src/THNN/generic/ClassNLLCriterion.c:21
But when I try:
y_train = y_train.squeeze_(1)
The algorithm goes on further finally, but I am getting strange loss values, e.g.:




Train Epoch: 3 [43100/45324 (95%)]
Loss: 1.242024




Train Epoch: 3 [43200/45324 (95%)]
Loss: 0.432863


Train Epoch: 3 [43300/45324 (96%)]
Loss: 0.725757


Train Epoch: 3 [43400/45324 (96%)]
Loss: 0.514305


Train Epoch: 3 [43500/45324 (96%)]
Loss: 0.267429


Train Epoch: 3 [43600/45324 (96%)]
Loss: 0.490571


Train Epoch: 3 [43700/45324 (96%)]
Loss: 0.444628


Train Epoch: 3 [43800/45324 (97%)]
Loss: 0.134719


Train Epoch: 3 [43900/45324 (97%)]
Loss: 0.142233


Train Epoch: 3 [44000/45324 (97%)]
Loss: 0.333635



It’s NLL after aplying log_softmax.
Is it normal that the loss jumps like this from like 0.13 ~ 1.24 in the training loop?
I would expect the model to be greadually improving to reach like ~0.9 accuracy
(of course against test set which I have not done yet)