Deep Learning, Pytorch, Fine Tuning, Computer Vision, Transfer Learning.
model.fc = nn.Linear(model.fc.in_features, num_classes) Freezing only convolutional layers in the network : # Freeze only the convolutional layers of the pre-trained model for param in model.parameters(): if isinstance(param, nn.Conv2d): param.requires_grad = False # Modify the model's head for a