alterzero / DBPN-Pytorch

The project is an official implement of our CVPR2018 paper "Deep Back-Projection Networks for Super-Resolution" (Winner of NTIRE2018 and PIRM2018)
https://alterzero.github.io/projects/DBPN.html
MIT License
566 stars 164 forks source link

Pre model not work #16

Closed kenwoodjw closed 6 years ago

kenwoodjw commented 6 years ago
python eval.py --upscale_factor 2
Namespace(chop_forward=True, gpu_mode=True, gpus=1, input_dir='Input', model='models/NTIRE2018_x8.pth', model_type='DBPNLL', output='Results/', seed=123, self_ensemble=True, testBatchSize=1, test_dataset='DIV2K_valid_LR_x8', threads=1, upscale_factor=2)
===> Loading datasets
===> Building model
/home/kenwood/DBPN-Pytorch/dbpn_v1.py:53: UserWarning: nn.init.kaiming_normal is now deprecated in favor of nn.init.kaiming_normal_.
  torch.nn.init.kaiming_normal(m.weight)
/home/kenwood/DBPN-Pytorch/dbpn_v1.py:57: UserWarning: nn.init.kaiming_normal is now deprecated in favor of nn.init.kaiming_normal_.
  torch.nn.init.kaiming_normal(m.weight)
Traceback (most recent call last):
  File "eval.py", line 63, in <module>
    model.load_state_dict(torch.load(opt.model, map_location=lambda storage, loc: storage))
  File "/root/.pyenv/versions/3.5.3/lib/python3.5/site-packages/torch/nn/modules/module.py", line 721, in load_state_dict
    self.__class__.__name__, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for DataParallel:
    While copying the parameter named "module.up1.up_conv1.deconv.weight", whose dimensions in the model are torch.Size([64, 64, 6, 6]) and whose dimensions in the checkpoint are torch.Size([64, 64, 12, 12]).
alterzero commented 6 years ago

Please use the scale on the corresponding model and model type. From your example, you try to run the code on scale x2 using x8 model.