Solved by chetan_patil in post #4 
              
              
                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 enum…