How can I extract intermediate layer output from loaded CNN model?

You could register a forward hook on model.fc3 as described here or alternatively manipulate the forward method and return the output activation of self.fc3 as well as from self.out.

13 Likes