EDSR遇到的问题以及解答

python main.py --data_test Demo --scale 2 --pre_train …/experiment/model/EDSR_x2.pt --test_only --save_results
RuntimeError: While copying the parameter named head.0.weight, whose dimensions in the model are torch.Size([64, 3, 3, 3]) and whose dimensions in the checkpoint are torch.Size([256, 3, 3, 3]).
这是因为PyTorch在设置检查点时不保存模型结构。
这意味着预先训练的模型只包含参数,而不包含结构。
因此,我们必须首先构建模型来加载这些参数。
默认设置是EDSR_baseline_x4,每个层有16个resblock和64个通道。
如果您没有指定这些参数,就会发生错误,因为您试图从具有32个resblock和每个层256个通道的模型加载参数。
You have to put additional arguments(–n_resblocks, --n_feats, and --res_scale) to test that model.
Please refer to this line!
Also, I recommend you to use --chop argument if there is any trouble with GPU memory.
Thank you.

所以要

python main.py --data_test DIV2K --ext img --n_val 100 --scale 4 --n_resblocks 32 --n_feats 256 --res_scale 0.1 --pre_train ../experiment/model/EDSR_x4.pt --test_only --self_ensemble
  • 7
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 10
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 10
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值