Solved by ptrblck in post #2 
              
              
                nn.CrossEntropyLoss() expects raw logits as the model output, as internally F.log_softmax and nn.NLLLoss will be applied, so you should remove the F.softmax in your model. 
Also, the target is expected to have the shape [batch_size] and contain class indices in the range [0, nb_classes-1], so these …