Retrieving intermediate features from pytorch torch.hub.load
I have a Net object instantiated in pytorch via torch.hub.load:
model = torch.hub.load('facebookresearch/pytorchvideo', 'slowfast_r50', pretrained=True)

The final layer is a projection to a 400-dim vector. Is there a way to get the pentultimate layer instead during a forward pass?

Yes, easiest way is to switch the layer with torch.nn.Identity (which simply returns it's inputs unchanged):
Line below changes this submodule:
(6): ResNetBasicHead(
      (dropout): Dropout(p=0.5, inplace=False)
      (proj): Linear(in_features=2304, out_features=400, bias=True)
      (output_pool): AdaptiveAvgPool3d(output_size=1)
    )

to Identity:
model.blocks[6] = torch.nn.Identity()

as you probably don't want to keep the Dropout anyway (you might only change proj or any other part of the network as needed).
