This is what I am thinking as well but I am not clear on how would I only extract the backbone of a pre-trained model. Mentally, I have the following forward pass:
def forward (self, x)
    with autocast(enabled=True):
        features = self.base_model(x)
        logits = self.classifier(features)
    return logits

My question is how should I extract the base_model from let’s say, torchvision.models.resnet50(pretrained=True throwing out the fc block from it.