I’m using the pre trained torchvision resnet50 model but I’m confused if my implementation this will work properly. I want to remove the FC and adaptive avg pooling layers. Is writing it out like this sensible? I’m concerned this way will chain together the relevant layers but without having the identity shortcut connections. Unless children() retains the relevant calls in forward?
class ResNet(nn.Module):
    def __init__(self, hparams):
        super(ResNet, self).__init__()
        
        self.stripped_body = nn.Sequential(*list(models.resnet50(pretrained=True).children())[:-2])
        
    def forward(self, img):     
  
        x = self.stripped_body(img)
        return x