Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using eval.py on pretrained models: size mismatch for module.output_conv.conv.weight: copying a param with shape torch.Size([3, 448, 3, 3]) from checkpoint, the shape in current model is torch.Size([3, 640, 3, 3]). #38

Closed
titsitits opened this issue Apr 29, 2019 · 1 comment

Comments

@titsitits
Copy link

Hi,

I am just trying your pre-trained models.
This commands works fine for me:
python eval.py --model './DBPNLL_x8.pth'

But using any other model, with or without changing the parameter "upscale_factor" leads to an error:
python eval.py --upscale_factor 4 --model './DBPN_x4.pth'
or
python eval.py --model './DBPN_x4.pth'
or
python eval.py --model './DBPN_x8.pth'

==>
RuntimeError: Error(s) in loading state_dict for DataParallel:
Missing key(s) in state_dict: "module.down7.conv.conv.weight", "module.down7.conv.conv.bias", "module.down7.conv.act.weight", "module.down7.down_conv1.conv.weight", "module.down7.down_conv1.conv.bias", "module.down7.down_conv1.act.weight", "module.down7.down_conv2.deconv.weight", "module.down7.down_conv2.deconv.bias", "module.down7.down_conv2.act.weight", "module.down7.down_conv3.conv.weight", "module.down7.down_conv3.conv.bias", "module.down7.down_conv3.act.weight", "module.up8.conv.conv.weight", "module.up8.conv.conv.bias", "module.up8.conv.act.weight", "module.up8.up_conv1.deconv.weight", "module.up8.up_conv1.deconv.bias", "module.up8.up_conv1.act.weight", "module.up8.up_conv2.conv.weight", "module.up8.up_conv2.conv.bias", "module.up8.up_conv2.act.weight", "module.up8.up_conv3.deconv.weight", "module.up8.up_conv3.deconv.bias", "module.up8.up_conv3.act.weight", "module.down8.conv.conv.weight", "module.down8.conv.conv.bias", "module.down8.conv.act.weight", "module.down8.down_conv1.conv.weight", "module.down8.down_conv1.conv.bias", "module.down8.down_conv1.act.weight", "module.down8.down_conv2.deconv.weight", "module.down8.down_conv2.deconv.bias", "module.down8.down_conv2.act.weight", "module.down8.down_conv3.conv.weight", "module.down8.down_conv3.conv.bias", "module.down8.down_conv3.act.weight", "module.up9.conv.conv.weight", "module.up9.conv.conv.bias", "module.up9.conv.act.weight", "module.up9.up_conv1.deconv.weight", "module.up9.up_conv1.deconv.bias", "module.up9.up_conv1.act.weight", "module.up9.up_conv2.conv.weight", "module.up9.up_conv2.conv.bias", "module.up9.up_conv2.act.weight", "module.up9.up_conv3.deconv.weight", "module.up9.up_conv3.deconv.bias", "module.up9.up_conv3.act.weight", "module.down9.conv.conv.weight", "module.down9.conv.conv.bias", "module.down9.conv.act.weight", "module.down9.down_conv1.conv.weight", "module.down9.down_conv1.conv.bias", "module.down9.down_conv1.act.weight", "module.down9.down_conv2.deconv.weight", "module.down9.down_conv2.deconv.bias", "module.down9.down_conv2.act.weight", "module.down9.down_conv3.conv.weight", "module.down9.down_conv3.conv.bias", "module.down9.down_conv3.act.weight", "module.up10.conv.conv.weight", "module.up10.conv.conv.bias", "module.up10.conv.act.weight", "module.up10.up_conv1.deconv.weight", "module.up10.up_conv1.deconv.bias", "module.up10.up_conv1.act.weight", "module.up10.up_conv2.conv.weight", "module.up10.up_conv2.conv.bias", "module.up10.up_conv2.act.weight", "module.up10.up_conv3.deconv.weight", "module.up10.up_conv3.deconv.bias", "module.up10.up_conv3.act.weight".
size mismatch for module.output_conv.conv.weight: copying a param with shape torch.Size([3, 448, 3, 3]) from checkpoint, the shape in current model is torch.Size([3, 640, 3, 3]).

Thank you in advance for your help.

@titsitits
Copy link
Author

OK there is a need to define the model type correctly for it to work:
python eval.py --upscale_factor 4 --model './DBPN_x4.pth' --model_type 'DBPN'

Hope it can help other users!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant