I loaded a torch7 model and I used unknown_classes=True (otherwise, I get issues with cudnn.SpatialConvolution).
m = load_lua('overfeatNet.t7', unknown_classes=True)
type(m)
torch.legacy.nn.Sequential.Sequential

The documentation (and @apaszke in this thread 16) says that using unknown_classes=True loads the object as a dict. But I don’t know how to use this dict. I know how to use the state_dict and load_state_dict with torchvision.models.model(pretrained=True).
One example I did for loading partial resnet18 model is as follows,
# ResNetBackBone is implementation of partial resnet18
backbone = ResNetBackBone(BasicBlock, [2, 2, 2, 2])

# load the state_dict from resnet18 to partial model 
backbone_dict = backbone.state_dict()
resnet18_dict = resnet18.state_dict()
resnet18_dict = {k: v for k, v in resnet18_dict.items() if k in backbone_dict}
backbone_dict.update(resnet18_dict)
backbone.load_state_dict(resnet18_dict)

The problem I facing in doing similar load_state_dict is, load_lua returns torch.legacy.nn.Sequential.Sequential that does not contain any state_dict member. Could someone please help me in loading models using load_lua ?