1

How can i generate intermediate layer output(third and forth MaxPool layer output) of VGG 16 in pytorch model.

pretrained_model = models.vgg16(pretrained=True)

Nwe
  • 11
  • 2

1 Answers1

0

you can use forward hook as described here: https://discuss.pytorch.org/t/how-can-l-load-my-best-model-as-a-feature-extractor-evaluator/17254/6

Alternatively, subclass the vgg16 model and manipulate its forward function.

Poe Dator
  • 4,535
  • 2
  • 14
  • 35