This might be a solution, but I would rather recommend to derive your custom ResNet module using the torchvision implementation from here 4.
Here is a small example using two custom linear layers:
import torchvision.models as models
import torch.utils.model_zoo as model_zoo

class MyResNet(models.ResNet):
    def __init__(self, block, layers, num_classes=1000, pretrained=False):
        super(MyResNet, self).__init__(block, layers, num_classes)
        if pretrained:
            self.load_state_dict(model_zoo.load_url(models.resnet.model_urls['resnet18']))
        num_ftrs = self.fc.in_features
        self.fc1 = nn.Linear(num_ftrs, 10)
        self.fc2 = nn.Linear(num_ftrs, 10)
        
    def forward(self, x):
        x = self.conv1(x)
        x = self.bn1(x)
        x = self.relu(x)
        x = self.maxpool(x)

        x = self.layer1(x)
        x = self.layer2(x)
        x = self.layer3(x)
        x = self.layer4(x)

        x = self.avgpool(x)
        x = x.view(x.size(0), -1)
        a = self.fc1(x)
        b = self.fc2(x)

        return a, b


model = MyResNet(models.resnet.BasicBlock, [2, 2, 2, 2], pretrained=True)
x = torch.randn(2, 3, 224, 224)
output1, output2 = model(x)

Note that the current master branch from torchvision changed the definition slightly, e.g. two new arguments were introduced:
zero_init_residual=False, norm_layer=None

If you are installing torchvision from source, you should add them to the code. Otherwise it should work using my example.