This solution looks correct.
model = models.resnet101(pretrained=True)
num_ftrs = model.fc.in_features
model.fc = nn.Linear(num_ftrs, 1)

Ensure you change you use a loss made for regression problems such as torch.nn.MSELoss.
You can use a network pre-trained on a classification problem and transfer it to a regression problem. You might need to unfreeze the last blocks to adapt it to your application.
The first blocks from ResNet or another net, will detect features such as edges, forms, which is mostly invariant when changing datasets.
Hope this helps!