I have a model in PyTorch and from one forward pass want to extract the outputs of several layers. Is that possible? e.g. the outputs of the first five convolutional layers of vgg
import torchvision
vgg = torchvision.models.vgg19_bn()
I have a model in PyTorch and from one forward pass want to extract the outputs of several layers. Is that possible? e.g. the outputs of the first five convolutional layers of vgg
import torchvision
vgg = torchvision.models.vgg19_bn()
Copyright © 2021 Jogjafile Inc.
I think the easiest way is to define a new model in which all layers of interest are defined: