XuecaiHu / Meta-SR-Pytorch

Meta-SR: A Magnification-Arbitrary Network for Super-Resolution (CVPR2019)
551 stars 121 forks source link

forward() missing 1 required positional argument: 'pos_mat' #42

Closed aligoglos closed 4 years ago

aligoglos commented 4 years ago

I've tried to run test code but this error raised:

Traceback (most recent call last):
  File "test.py", line 20, in <module>
    while not t.terminate():
  File "D:\Artificial Intelligence\SuperResolution\Images\Meta-SR-Pytorch-master\trainer.py", line 284, in terminate
    self.test()
  File "D:\Artificial Intelligence\SuperResolution\Images\Meta-SR-Pytorch-master\trainer.py", line 233, in test
    sr = self.model(lr, idx_scale,pos_mat = scale_coord_map)
  File "C:\Users\127051\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\nn\modules\module.py", line 541, in __call__
    result = self.forward(*input, **kwargs)
  File "D:\Artificial Intelligence\SuperResolution\Images\Meta-SR-Pytorch-master\model\__init__.py", line 52, in forward
    return self.forward_chop(x)
  File "D:\Artificial Intelligence\SuperResolution\Images\Meta-SR-Pytorch-master\model\__init__.py", line 132, in forward_chop
    sr_batch = self.model(lr_batch)
  File "C:\Users\127051\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\nn\modules\module.py", line 541, in __call__
    result = self.forward(*input, **kwargs)
TypeError: forward() missing 1 required positional argument: 'pos_mat'
XuecaiHu commented 4 years ago

hi, buddy. The reason is that you enable the chop . However, our meta-sr donot implement this function. So please disable it.

XuecaiHu commented 4 years ago

i have update the code. Now the code support the chop option. But i think the implementation is not very perfect.