These seem to be a few issues in your PyTorch code:

you are assigning layers to new (and thus) unused attributes. model.adaptiveavgpool does not exist in resnet50, so you are creating a new attribute (maybe you want to change model.avgpool?).
same for model.activation

If your criterion is nn.CrossEntropyLoss, pass the raw logits without the softmax to the criterion.
Internally F.log_softmax and nn.NLLLoss will be applied.