Reset weight for fc layer

in cross validation i use pre-trained model, i need to reset just the weights of Fc layer (classifier layer) , Thanks :slight_smile:

You can simply assign the last layer manually after loading it.

pretrained_model = [some steps that gave me the pretrained model]
pretrained_model.fc = nn.Linear(input_channels, num_classes)

should work for most pretrained models in torchvision.