change_detection.pytorch icon indicating copy to clipboard operation
change_detection.pytorch copied to clipboard

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

Open yuxin7 opened this issue 2 years ago • 1 comments

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)

yuxin7 avatar Feb 24 '23 08:02 yuxin7

请问你解决了吗?

xuxiansheng2018 avatar Nov 30 '23 08:11 xuxiansheng2018