Extract features with ResNet-152 from shallow convolutional layer


How can l extract features with ResNet152 from the convolutional layer where the dimensions of the output of the convolutional layer is equal to those of the input image (224,224) ?

The following allows to extract features from the last fully connected layer :

resnet152 = models.resnet152(pretrained=True)
modules = list(resnet152.children())[:-1]
resnet152 = nn.Sequential(*modules)

In other term, l’m looking for the convolutional layer where its dimensions match with those of input image . If it doesn’t apply, what is the convolutional layer with highest dimensions (near to those of input image) ? so that l can apply upsampling on the output of that layer to match the dimension of input image.

Thank you