Get data from intermediate layers in a Pytorch model I was trying to implement SRGAN in PyTorch and I have to write a Content loss function that required me to fetch activations from intermediate layers for both the Generated Image &amp; Original Image.
I'm using pretrained VGG-19 and according to the paper I need the ReLU activations
Can anybody guide me on how can I achieve this?
You can save the activations for intermediate layers into a variable within your forward method and then return them in addition to the output value.