Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

当你的输入图片不是32的倍数时,调用Unet和Unet++会报错。 #25

Open
yuxin7 opened this issue Feb 24, 2023 · 1 comment

Comments

@yuxin7
Copy link

yuxin7 commented Feb 24, 2023

warnings.warn("pyprof will be removed by the end of June, 2022", FutureWarning)
Traceback (most recent call last):
File "D:/WorkSpace/PythonWorkSpace/change_detection/test.py", line 60, in
y_pred = model(img1, img2)
File "D:\Software\Anconda\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 889, in call_impl
result = self.forward(*input, **kwargs)
File "D:\WorkSpace\PythonWorkSpace\change_detection\change_detection_pytorch\base\model.py", line 35, in forward
return self.base_forward(x1, x2)
File "D:\WorkSpace\PythonWorkSpace\change_detection\change_detection_pytorch\base\model.py", line 20, in base_forward
decoder_output = self.decoder(*features)
File "D:\Software\Anconda\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 889, in call_impl
result = self.forward(*input, **kwargs)
File "D:\WorkSpace\PythonWorkSpace\change_detection\change_detection_pytorch\unetplusplus\decoder.py", line 137, in forward
output = self.blocks[f'x
{depth_idx}
{depth_idx}'](features[depth_idx], features[depth_idx+1])
File "D:\Software\Anconda\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "D:\WorkSpace\PythonWorkSpace\change_detection\change_detection_pytorch\unetplusplus\decoder.py", line 39, in forward
x = torch.cat([x, skip], dim=1)
RuntimeError: Sizes of tensors must match except in dimension 2. Got 49 and 50 (The offending index is 0)
RuntimeError: Sizes of tensors must match except in dimension 2. Got 49 and 50 (The offending index is 0)

@xuxiansheng2018
Copy link

请问你解决了吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants