Hi,
You just have to create new state_dict from resnet50 model which doesn’t contain last fully connected classification layer and load it to the fcn_resnet50.backbone.
import torchvision
from collections import OrderedDict
m1 = torchvision.models.segmentation.fcn_resnet50(pretrained=False, num_classes=21)
m2 = torchvision.models.resnet50(pretrained=True)

new_state_dict = OrderedDict()
for k, v in m2.state_dict().items():
    if k != "fc.weight" and k != "fc.bias":
        new_state_dict[k] = v

m1.backbone.load_state_dict(new_state_dict)