The training loop looks alright.
Are you working on a multi-label (each sample belongs to 0, 1 or more classes) or multi-class (each sample belongs to a single class only) classification?
In the former case nn.NLLLoss is most likely the wrong criterion to use.
Also, what did you change in the resnet? Since you are using nn.NLLLoss, you would have to add F.log_softmax as the last activation function.