Sure you can do whatever you want with this model! To extract the features from, say (2) layer, use vgg16.features[:3](input)
. Note that vgg16
has 2 parts features
and classifier
. You can call them separately and slice them as you wish and use them as operator on any input.
For the above example, vgg16.features[:3]
will slice out first 3 layers (0, 1 and 2) from the features
part of model and then I operated the sliced sequence on input
.