Solved by KarthikR in post #2 
              
              
                You need to pass value to the vgg_name variable used in the ‘init’ function. 
Try like below: 
class VGG(nn.Module): 
def  init (self, cfg, vgg_name): 
super(VGG, self). init () 
self.features = self._make_layers(cfg[vgg_name]) 
… 
… 
Then: 
net = VGG(cfg, ‘VGG11’)