Error loading pretrained model
Opened this issue · 1 comments
skerit commented
Just like in issue #21 I get an error when I load the pre-trained RBPN_4x.pth
model:
Namespace(chop_forward=False, data_dir='./Vid4', file_list='foliage.txt', future_frame=True, gpu_mode=True, gpus=1, model='weights/RBPN_4x.pth', model_type='RBPN', nFrames=7, other_dataset=True, output='Results/', residual=False, seed=123, testBatchSize=1, threads=1, upscale_factor=4)
===> Loading datasets
===> Building model RBPN
Traceback (most recent call last):
File "eval.py", line 67, in <module>
model.load_state_dict(torch.load(opt.model, map_location=lambda storage, loc: storage))
File "/home/skerit/projects/miniconda3/envs/py35/lib/python3.5/site-packages/torch/nn/modules/module.py", line 847, in load_state_dict
self.__class__.__name__, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for Net:
Missing key(s) in state_dict: "feat0.conv.bias", "feat0.conv.weight", "feat0.act.weight", "feat1.conv.bias", "feat1.conv.weight", "feat1.act.weight", "DBPN.feat1.conv.bias", "DBPN.feat1.conv.weight", "DBPN.feat1.act.weight", "DBPN.up1.up_conv1.deconv.bias", "DBPN.up1.up_conv1.deconv.weight", "DBPN.up1.up_conv1.act.weight", "DBPN.up1.up_conv2.conv.bias", "DBPN.up1.up_conv2.conv.weight", "DBPN.up1.up_conv2.act.weight", "DBPN.up1.up_conv3.deconv.bias", "DBPN.up1.up_conv3.deconv.weight", "DBPN.up1.up_conv3.act.weight", "DBPN.down1.down_conv1.conv.bias", "DBPN.down1.down_conv1.conv.weight", "DBPN.down1.down_conv1.act.weight", "DBPN.down1.down_conv2.deconv.bias", "DBPN.down1.down_conv2.deconv.weight", "DBPN.down1.down_conv2.act.weight", "DBPN.down1.down_conv3.conv.bias", "DBPN.down1.down_conv3.conv.weight", "DBPN.down1.down_conv3.act.weight", "DBPN.up2.up_conv1.deconv.bias", "DBPN.up2.up_conv1.deconv.weight", "DBPN.up2.up_conv1.act.weight", "DBPN.up2.up_conv2.conv.bias", "DBPN.up2.up_conv2.conv.weight", "DBPN.up2.up_conv2.act.weight", "DBPN.up2.up_conv3.deconv.bias", "DBPN.up2.up_conv3.deconv.weight", "DBPN.up2.up_conv3.act.weight", "DBPN.down2.down_conv1.conv.bias", "DBPN.down2.down_conv1.conv.weight", "DBPN.down2.down_conv1.act.weight", "DBPN.down2.down_conv2.deconv.bias", "DBPN.down2.down_conv2.deconv.weight", "DBPN.down2.down_conv2.act.weight", "DBPN.down2.down_conv3.conv.bias", "DBPN.down2.down_conv3.conv.weight", "DBPN.down2.down_conv3.act.weight", "DBPN.up3.up_conv1.deconv.bias", "DBPN.up3.up_conv1.deconv.weight", "DBPN.up3.up_conv1.act.weight", "DBPN.up3.up_conv2.conv.bias", "DBPN.up3.up_conv2.conv.weight", "DBPN.up3.up_conv2.act.weight", "DBPN.up3.up_conv3.deconv.bias", "DBPN.up3.up_conv3.deconv.weight", "DBPN.up3.up_conv3.act.weight", "DBPN.output.conv.bias", "DBPN.output.conv.weight", "res_feat1.0.conv1.bias", "res_feat1.0.conv1.weight", "res_feat1.0.conv2.bias", "res_feat1.0.conv2.weight", "res_feat1.0.act.weight", "res_feat1.1.conv1.bias", "res_feat1.1.conv1.weight", "res_feat1.1.conv2.bias", "res_feat1.1.conv2.weight", "res_feat1.1.act.weight", "res_feat1.2.conv1.bias", "res_feat1.2.conv1.weight", "res_feat1.2.conv2.bias", "res_feat1.2.conv2.weight", "res_feat1.2.act.weight", "res_feat1.3.conv1.bias", "res_feat1.3.conv1.weight", "res_feat1.3.conv2.bias", "res_feat1.3.conv2.weight", "res_feat1.3.act.weight", "res_feat1.4.conv1.bias", "res_feat1.4.conv1.weight", "res_feat1.4.conv2.bias", "res_feat1.4.conv2.weight", "res_feat1.4.act.weight", "res_feat1.5.deconv.bias", "res_feat1.5.deconv.weight", "res_feat1.5.act.weight", "res_feat2.0.conv1.bias", "res_feat2.0.conv1.weight", "res_feat2.0.conv2.bias", "res_feat2.0.conv2.weight", "res_feat2.0.act.weight", "res_feat2.1.conv1.bias", "res_feat2.1.conv1.weight", "res_feat2.1.conv2.bias", "res_feat2.1.conv2.weight", "res_feat2.1.act.weight", "res_feat2.2.conv1.bias", "res_feat2.2.conv1.weight", "res_feat2.2.conv2.bias", "res_feat2.2.conv2.weight", "res_feat2.2.act.weight", "res_feat2.3.conv1.bias", "res_feat2.3.conv1.weight", "res_feat2.3.conv2.bias", "res_feat2.3.conv2.weight", "res_feat2.3.act.weight", "res_feat2.4.conv1.bias", "res_feat2.4.conv1.weight", "res_feat2.4.conv2.bias", "res_feat2.4.conv2.weight", "res_feat2.4.act.weight", "res_feat2.5.conv.bias", "res_feat2.5.conv.weight", "res_feat2.5.act.weight", "res_feat3.0.conv1.bias", "res_feat3.0.conv1.weight", "res_feat3.0.conv2.bias", "res_feat3.0.conv2.weight", "res_feat3.0.act.weight", "res_feat3.1.conv1.bias", "res_feat3.1.conv1.weight", "res_feat3.1.conv2.bias", "res_feat3.1.conv2.weight", "res_feat3.1.act.weight", "res_feat3.2.conv1.bias", "res_feat3.2.conv1.weight", "res_feat3.2.conv2.bias", "res_feat3.2.conv2.weight", "res_feat3.2.act.weight", "res_feat3.3.conv1.bias", "res_feat3.3.conv1.weight", "res_feat3.3.conv2.bias", "res_feat3.3.conv2.weight", "res_feat3.3.act.weight", "res_feat3.4.conv1.bias", "res_feat3.4.conv1.weight", "res_feat3.4.conv2.bias", "res_feat3.4.conv2.weight", "res_feat3.4.act.weight", "res_feat3.5.conv.bias", "res_feat3.5.conv.weight", "res_feat3.5.act.weight", "output.conv.bias", "output.conv.weight".
Unexpected key(s) in state_dict: "module.feat0.conv.weight", "module.feat0.conv.bias", "module.feat0.act.weight", "module.feat1.conv.weight", "module.feat1.conv.bias", "module.feat1.act.weight", "module.DBPN.feat1.conv.weight", "module.DBPN.feat1.conv.bias", "module.DBPN.feat1.act.weight", "module.DBPN.up1.up_conv1.deconv.weight", "module.DBPN.up1.up_conv1.deconv.bias", "module.DBPN.up1.up_conv1.act.weight", "module.DBPN.up1.up_conv2.conv.weight", "module.DBPN.up1.up_conv2.conv.bias", "module.DBPN.up1.up_conv2.act.weight", "module.DBPN.up1.up_conv3.deconv.weight", "module.DBPN.up1.up_conv3.deconv.bias", "module.DBPN.up1.up_conv3.act.weight", "module.DBPN.down1.down_conv1.conv.weight", "module.DBPN.down1.down_conv1.conv.bias", "module.DBPN.down1.down_conv1.act.weight", "module.DBPN.down1.down_conv2.deconv.weight", "module.DBPN.down1.down_conv2.deconv.bias", "module.DBPN.down1.down_conv2.act.weight", "module.DBPN.down1.down_conv3.conv.weight", "module.DBPN.down1.down_conv3.conv.bias", "module.DBPN.down1.down_conv3.act.weight", "module.DBPN.up2.up_conv1.deconv.weight", "module.DBPN.up2.up_conv1.deconv.bias", "module.DBPN.up2.up_conv1.act.weight", "module.DBPN.up2.up_conv2.conv.weight", "module.DBPN.up2.up_conv2.conv.bias", "module.DBPN.up2.up_conv2.act.weight", "module.DBPN.up2.up_conv3.deconv.weight", "module.DBPN.up2.up_conv3.deconv.bias", "module.DBPN.up2.up_conv3.act.weight", "module.DBPN.down2.down_conv1.conv.weight", "module.DBPN.down2.down_conv1.conv.bias", "module.DBPN.down2.down_conv1.act.weight", "module.DBPN.down2.down_conv2.deconv.weight", "module.DBPN.down2.down_conv2.deconv.bias", "module.DBPN.down2.down_conv2.act.weight", "module.DBPN.down2.down_conv3.conv.weight", "module.DBPN.down2.down_conv3.conv.bias", "module.DBPN.down2.down_conv3.act.weight", "module.DBPN.up3.up_conv1.deconv.weight", "module.DBPN.up3.up_conv1.deconv.bias", "module.DBPN.up3.up_conv1.act.weight", "module.DBPN.up3.up_conv2.conv.weight", "module.DBPN.up3.up_conv2.conv.bias", "module.DBPN.up3.up_conv2.act.weight", "module.DBPN.up3.up_conv3.deconv.weight", "module.DBPN.up3.up_conv3.deconv.bias", "module.DBPN.up3.up_conv3.act.weight", "module.DBPN.output.conv.weight", "module.DBPN.output.conv.bias", "module.res_feat1.0.conv1.weight", "module.res_feat1.0.conv1.bias", "module.res_feat1.0.conv2.weight", "module.res_feat1.0.conv2.bias", "module.res_feat1.0.act.weight", "module.res_feat1.1.conv1.weight", "module.res_feat1.1.conv1.bias", "module.res_feat1.1.conv2.weight", "module.res_feat1.1.conv2.bias", "module.res_feat1.1.act.weight", "module.res_feat1.2.conv1.weight", "module.res_feat1.2.conv1.bias", "module.res_feat1.2.conv2.weight", "module.res_feat1.2.conv2.bias", "module.res_feat1.2.act.weight", "module.res_feat1.3.conv1.weight", "module.res_feat1.3.conv1.bias", "module.res_feat1.3.conv2.weight", "module.res_feat1.3.conv2.bias", "module.res_feat1.3.act.weight", "module.res_feat1.4.conv1.weight", "module.res_feat1.4.conv1.bias", "module.res_feat1.4.conv2.weight", "module.res_feat1.4.conv2.bias", "module.res_feat1.4.act.weight", "module.res_feat1.5.deconv.weight", "module.res_feat1.5.deconv.bias", "module.res_feat1.5.act.weight", "module.res_feat2.0.conv1.weight", "module.res_feat2.0.conv1.bias", "module.res_feat2.0.conv2.weight", "module.res_feat2.0.conv2.bias", "module.res_feat2.0.act.weight", "module.res_feat2.1.conv1.weight", "module.res_feat2.1.conv1.bias", "module.res_feat2.1.conv2.weight", "module.res_feat2.1.conv2.bias", "module.res_feat2.1.act.weight", "module.res_feat2.2.conv1.weight", "module.res_feat2.2.conv1.bias", "module.res_feat2.2.conv2.weight", "module.res_feat2.2.conv2.bias", "module.res_feat2.2.act.weight", "module.res_feat2.3.conv1.weight", "module.res_feat2.3.conv1.bias", "module.res_feat2.3.conv2.weight", "module.res_feat2.3.conv2.bias", "module.res_feat2.3.act.weight", "module.res_feat2.4.conv1.weight", "module.res_feat2.4.conv1.bias", "module.res_feat2.4.conv2.weight", "module.res_feat2.4.conv2.bias", "module.res_feat2.4.act.weight", "module.res_feat2.5.conv.weight", "module.res_feat2.5.conv.bias", "module.res_feat2.5.act.weight", "module.res_feat3.0.conv1.weight", "module.res_feat3.0.conv1.bias", "module.res_feat3.0.conv2.weight", "module.res_feat3.0.conv2.bias", "module.res_feat3.0.act.weight", "module.res_feat3.1.conv1.weight", "module.res_feat3.1.conv1.bias", "module.res_feat3.1.conv2.weight", "module.res_feat3.1.conv2.bias", "module.res_feat3.1.act.weight", "module.res_feat3.2.conv1.weight", "module.res_feat3.2.conv1.bias", "module.res_feat3.2.conv2.weight", "module.res_feat3.2.conv2.bias", "module.res_feat3.2.act.weight", "module.res_feat3.3.conv1.weight", "module.res_feat3.3.conv1.bias", "module.res_feat3.3.conv2.weight", "module.res_feat3.3.conv2.bias", "module.res_feat3.3.act.weight", "module.res_feat3.4.conv1.weight", "module.res_feat3.4.conv1.bias", "module.res_feat3.4.conv2.weight", "module.res_feat3.4.conv2.bias", "module.res_feat3.4.act.weight", "module.res_feat3.5.conv.weight", "module.res_feat3.5.conv.bias", "module.res_feat3.5.act.weight", "module.output.conv.weight", "module.output.conv.bias".
Any idea what I'm missing?
skerit commented
According to this thread on the pytorch forum, the pretrained model was saved using something called nn.DataParallel
, but the eval.py
script will only do something with that if cuda is enabled.
And I have disabled it, because I don't have cuda.
I managed to work around the loading of the model (with the help from the discussion on pytorch.org), but it still doesn't work. I looked at the file some more, and I guess disabling cuda isn't something that is actually supported?