Holmes-Alan / dSRVAE

Unsupervised Real Image Super-Resolution via Variational AutoEncoder in CVPR2020
119 stars 15 forks source link

TypeError: forward() missing 1 required positional argument: 'down_ref' #12

Closed yui1061236135 closed 2 years ago

yui1061236135 commented 3 years ago

Traceback (most recent call last): File "main_denoiser.py", line 142, in train(epoch) File "main_denoiser.py", line 63, in train Denoise_LR, KL = model(HR_feat, input) File "D:\Anaconda3\envs\SR\lib\site-packages\torch\nn\modules\module.py", line 532, in call result = self.forward(*input, kwargs) File "D:\Anaconda3\envs\SR\lib\site-packages\torch\nn\parallel\data_parallel.py", line 150, in forward return self.module(*inputs[0], *kwargs[0]) File "D:\Anaconda3\envs\SR\lib\site-packages\torch\nn\modules\module.py", line 532, in call result = self.forward(input, kwargs) TypeError: forward() missing 1 required positional argument: 'down_ref

I don't know how to fix the problem,please help

Marios654 commented 2 years ago

stuck in here as well i took a look in modules.py and i found where down_ref is required image_2022-03-09_224629

down ref is an argument for the decode and forward function but no indication is given in regarding to what it is @Holmes-Alan or @yui1061236135 could you help me please??

if i try to remove down_ref as an argument then i get the following error message

Traceback (most recent call last): File "C:\Users\mario\Desktop\dSRVAE-master\main_denoiser.py", line 159, in train(epoch) File "C:\Users\mario\Desktop\dSRVAE-master\main_denoiser.py", line 78, in train Denoise_LR, KL = model(HR_feat, input) File "C:\Users\mario\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl return forward_call(*input, kwargs) File "C:\Users\mario\Desktop\dSRVAE-master\modules.py", line 232, in forward z_q_mu, z_q_logvar = self.encode(HR_feat) File "C:\Users\mario\Desktop\dSRVAE-master\modules.py", line 210, in encode x = self.VAE_encoder(HR_feat.view(HR_feat.size(0), -1)) File "C:\Users\mario\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl return forward_call(*input, *kwargs) File "C:\Users\mario\anaconda3\lib\site-packages\torch\nn\modules\container.py", line 141, in forward input = module(input) File "C:\Users\mario\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl return forward_call(input, kwargs) File "C:\Users\mario\anaconda3\lib\site-packages\torch\nn\modules\linear.py", line 103, in forward return F.linear(input, self.weight, self.bias) File "C:\Users\mario\anaconda3\lib\site-packages\torch\nn\functional.py", line 1848, in linear return torch._C._nn.linear(input, weight, bias) RuntimeError: mat1 and mat2 shapes cannot be multiplied (512x512 and 8192x4096)

Any feedback would be apreciated thank you in advance!!!!

Holmes-Alan commented 2 years ago

Hello, you can remove "down_ref" from the function since it is not used. I have updated the file and you can try again.