I am getting very different results when using pretrained models using torchvision.models and timm.
For example the only difference in my code is between
self.model=models.resnet18(weights=models.ResNet18_Weights.DEFAULT)
self.model.fc=nn.Linear(self.model.fc.in_features,num_classes)
return self.model
and
self.model=timm.create_model(model_name='resnet18',num_classes=num_classes,pretrained=True)
return self.model
The results are show below for the training accuracy (it is similar for validation accuracy but I am allowed to post one figure).