Make sure to pass the logits to nn.CrossEntropyLoss, as internally F.log_softmax and F.nll_loss will be used. If you want to get the probabilities (e.g. to print them) you can use F.softmax(output, dim=1), but don’t pass them to the criterion.