Solved by ptrblck in post #2 
              
              
                This code should work: 

class MyDeepLab(nn.Module):

    def __init__(self, in_channels=1):
        super(MyDeepLab, self).__init__()
        self.model = torch.hub.load('pytorch/vision:v0.5.0', 'deeplabv3_resnet101', pretrained=True)
        with torch.no_grad():
            conv_weight = self.mod…