Thanks for your reply. I followed the imagenet code where the checkpoint is saved.
    save_checkpoint({
        'epoch': epoch + 1,
        'arch': args.arch,
        'state_dict': model.state_dict(),
        'best_prec1': best_prec1,
        'optimizer' : optimizer.state_dict(),
    }, is_best)

So the following should be the correct way to load the model.
cnn = models.vgg19()
cnn.features = torch.nn.DataParallel(cnn.features)
cnn.cuda()
checkpoint = torch.load(‘models/checkpoint.pth.tar’)
cnn.load_state_dict(checkpoint[‘state_dict’])
In this case, the loading works fine. But if I want to iterate the CNN,
for i,layer in enumerate(list(cnn)):
it gives me TypeError: ‘VGG’ object is not iterable. So I guess I am not loading the model the way I want?