sanghyun-son / EDSR-PyTorch

PyTorch version of the paper 'Enhanced Deep Residual Networks for Single Image Super-Resolution' (CVPRW 2017)
MIT License
2.43k stars 669 forks source link

Number of Residual Blocks #238

Closed tanmay2298 closed 4 years ago

tanmay2298 commented 4 years ago

Hi,

I'm unable to vary the residual blocks.

Here is the command I tested in demo.sh file python main.py --model EDSR --scale 2 --save edsr_x2 --n_resblocks 16 --n_feats 256 --res_scale 0.1 --reset --ext sep --batch_size 16 --epoch 600 --patch_size 96 --n_GPUs 2 --chop --optimizer ADAM

The output was as follows - File "main.py", line 33, in <module> main() File "main.py", line 23, in main _model = model.Model(args, checkpoint) File "/home/t2gulati/Super-Resolution-using-Deep-Learning/Code/EDSR/EDSR-PyTorch/src/model/__init__.py", line 26, in __init__ self.model = module.make_model(args).to(self.device) File "/home/t2gulati/Super-Resolution-using-Deep-Learning/Code/EDSR/EDSR-PyTorch/src/model/edsr.py", line 15, in make_model return EDSR(args) File "/home/t2gulati/Super-Resolution-using-Deep-Learning/Code/EDSR/EDSR-PyTorch/src/model/edsr.py", line 26, in __init__ self.url = url['r{}f{}x{}'.format(n_resblocks, n_feats, scale)] KeyError: 'r16f256x2'

Please let me know how I should I go about resolving this

Thank you!

AbdulMoqeet commented 4 years ago

It is because of the URL dictionary. You have used r16f256x2but there is no entry with such name in URL dictionary. Check the initial lines of edsr.py Either change --n_resblocks to 32or comment out the URL section in the code so that it could avoid it.