Skip to content

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

Open
@yuxin7

Description

@yuxin7

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions