I’m not entirely sure so perhaps someone can confirm, but I think your way should work and not remove the skip connections. I feel you could also use something like this:
model = models.resnet50(pretrained=True)
model.avgpool = nn.Identity()
model.fc = nn.Sequential(nn.Linear(input_size, num_classes))

Edit: Or I guess in your case, setting
model.fc = nn.Identity()

as well.