There is a small mistake in reassigning the last linear layer.
In resnet50 the last linear layer is called self.fc instead of self.fc1.
Even though you assigned a new layer to self.fc1, this layer wasn’t used and your model was basically a pretrained ResNet with 1000 output classes.
Fix this typo and try to train your model again.
Also, note that the number of input features for the last linear layer should be 2048 for resnet50.