nn.CrossEntropyLoss expects raw logits as the model output, since internally F.log_softmax and nn.NLLLoss will be applied.
Remove the F.softmax(x,dim=1) in the forward method of your model and rerun the code.
Let me know, if this helps.