You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In lib/losses3D/BaseClass.py, I encountered an error on line 56:
assert input.size() == target.size(), "'input' and 'target' must have the same shape"
Upon inspection, I found that the shapes of input and target are different:
input.shape: torch.Size([4, 4, 128, 128, 48])
target.shape: torch.Size([4, 1, 128, 128, 48])
The mismatch occurs in dimension 1 (the channels dimension).
After debugging, I traced the source of input and target to the prepare_input function in lib/utils/general.py. At this stage:
The function parameters are modalities == 3 and channels == 3
At this point, target.shape is already torch.Size([4, 1, 128, 128, 48])
However, after passing through the convolutional layers, input_tensor transforms from torch.Size([4, 3, 128, 128, 48]) to torch.Size([4, 4, 128, 128, 48]), leading to the shape mismatch.
The text was updated successfully, but these errors were encountered:
In
lib/losses3D/BaseClass.py
, I encountered an error on line 56:Upon inspection, I found that the shapes of
input
andtarget
are different:input.shape
:torch.Size([4, 4, 128, 128, 48])
target.shape
:torch.Size([4, 1, 128, 128, 48])
The mismatch occurs in dimension 1 (the channels dimension).
After debugging, I traced the source of
input
andtarget
to theprepare_input
function inlib/utils/general.py
. At this stage:modalities == 3
andchannels == 3
target.shape
is alreadytorch.Size([4, 1, 128, 128, 48])
input_tensor
transforms fromtorch.Size([4, 3, 128, 128, 48])
totorch.Size([4, 4, 128, 128, 48])
, leading to the shape mismatch.The text was updated successfully, but these errors were encountered: