I have a similar question, but for the fcn resnet 101 segmentation model. In my case I am following this tutorial 8 and I am trying to adapt this part of the code to fcn resnet 101.
The code from the tutorial is:
    if model_name == "resnet":
        """ Resnet18
        """
        model_ft = models.resnet18(pretrained=use_pretrained)
        set_parameter_requires_grad(model_ft, feature_extract)
        num_ftrs = model_ft.fc.in_features
        model_ft.fc = nn.Linear(num_ftrs, num_classes)
        input_size = 224

and so far I have changed it to:
if model_name == "resnet":

        """ FCN_resnet101
        """
        model_ft = models.segmentation.fcn_resnet101(pretrained=use_pretrained)
        set_parameter_requires_grad(model_ft, feature_extract)
        num_ftrs = model_ft.fc.in_features
        model_ft.fc = nn.Linear(num_ftrs, num_classes)
        input_size = 768, 1024

When I do this I get this error: ‘FCN’ object has no attribute ‘fc’
So I was wondering how I can change the two lines below to work with the fcn segmentation model
        num_ftrs = model_ft.fc.in_features
        model_ft.fc = nn.Linear(num_ftrs, num_classes)