Get right accuracy

Please help me,
I use crossentrpyloss for loss function. how is the right way to obtain the right accuracy for the loss function that I use?

The documentation provides quite details here about CrossEntropyLoss.
It’s better to read it carefully first and give it a try in your case to see how it goes. Keep in mind that the prediction from your model must the logits (don’t use softmax or logsoftmax at the end of your model).