In Pytorch, nn.CrossEntropyLoss combines LogSoftmax and NLLLoss. Your input to nn.CrossEntropyLoss should be logits and the original targets and not the softmax probabilities themselves .
Also, it should not be used as
 loss=nn.CrossEntropyLoss(output, target)
but instead as below:
 loss = nn.CrossEntropyLoss()(output, target)
Do share your training loop code if possible.