Hi, I tried using nn.Sequential() and in my case for vgg_modules works,
import torch
import torchvision.models as models
import torch.nn as nn

vgg_modules = list(models.vgg16(pretrained=True).features)
modules = nn.Sequential(*vgg_modules)
result = []
x = torch.randn(1,3,42,42)

for i, mod in enumerate(modules):
    x = mod(x)
    # print("Passed layer {}".format(i))
    if i in {1, 3, 5, 7, 9}:
        result.append(x)
        if i>10:
            break

print("done.!!", len(result))