How to get feature map from pre-trained Resnet50

I want to extract feature maps from pre-trained ResNet50 model.
Actually, I’m trying to make image-captioning model and need to get feature maps from images.
However, I cannot find good ways to do that.
Does anyone know the way for that and show me the code to make it possible?

You could use forward hooks to get the activation maps as described in this example.

1 Like

thank you for your quick answering.
I’ll check it out!