Extracting Features from my pretrained CNN, not from Model Zoo

You could register a forward hook to the layer you would like to get the activations from.
Have a look at this example.

Another approach would be to modify the forward method and return the desired activation.

1 Like