Bug in testing Set5 X3 with `args.chop=True`
See original GitHub issueWhen I set args.chop=False
, everything goes well. When I set it to True, it outputs errors as:
Evaluation:################################################ 2019-10-10-16:38:03
40%|██████████████████ | 2/5 [00:02<00:04, 1.36s/it]
Traceback (most recent call last):
File "/anaconda3/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3325, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-2-8439669b053c>", line 1, in <module>
runfile('/Code/EDSR-PyTorch-master/src/main.py', wdir='/Code/EDSR-PyTorch-master/src')
File "/.pycharm_helpers/pydev/_pydev_bundle/pydev_umd.py", line 197, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "/.pycharm_helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/Code/EDSR-PyTorch-master/src/main.py", line 41, in <module>
main()
File "/Code/EDSR-PyTorch-master/src/main.py", line 32, in main
while not t.terminate():
File "/Code/EDSR-PyTorch-master/src/trainer.py", line 141, in terminate
self.test()
File "/Code/EDSR-PyTorch-master/src/trainer.py", line 91, in test
sr = self.model(lr, idx_scale)
File "/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 547, in __call__
result = self.forward(*input, **kwargs)
File "/Code/EDSR-PyTorch-master/src/model/__init__.py", line 62, in forward
return forward_function(x)
File "/Code/EDSR-PyTorch-master/src/model/__init__.py", line 175, in forward_chop
_y[..., top, right] = y_chop[1][..., top, right_r]
RuntimeError: The expanded size of the tensor (127) must match the existing size (128) at non-singleton dimension 3. Target sizes: [1, 3, 127, 127]. Tensor sizes: [3, 127, 128]
Note that I have no problem with training. In testing, for X2 and X4, args.chop=True
works good. For X3, some images in Set5 and Set14 would have problems. By the way, I download the processed datasets directly from your link in Readme.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7
Top Results From Across the Web
RuntimeError: expected input to have 3 channels, but got 4 ...
As it is known, my test images have 3 channels, but I got an error as follows, ... issue shows a similar error,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Edit
EDSR-PyTorch-master/src/model/__init__.py
as follow:@HolmesShuan, Thanks for your reply! I have solved this issue by replacing
forward_chop
in EDSR withforward_chop
inRCAN
(PyTorch0.4.0). My model shows this change doesn’t affect my accuracy. But, I still thank you very much!