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
out = conv(out, weight=win.transpose(2 + i, -1), stride=1, padding=0, groups=C)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: expected stride to be a single integer value or a list of 2 values to match the convolution dimensions, but got stride=[1, 1, 1]
though weight was 4D? is this incorrect and requires and undate?
defgaussian_filter(input: Tensor, win: Tensor) ->Tensor:
r""" Blur input with 1-D kernel Args: input (torch.Tensor): a batch of tensors to be blurred window (torch.Tensor): 1-D gauss kernel Returns: torch.Tensor: blurred tensors """ndim=input.dim()
assertall([ws==1forwsinwin.shape[1:-1]]), win.shapeifndim==4:
conv=F.conv2delifndim==5:
conv=F.conv3delse:
raiseNotImplementedError(input.shape)
C=input.shape[1]
out=inputfori, sinenumerate(input.shape[2:]):
ifndim==5:
weight=win.view(1, 1, 1, 1, win.shape[-1])
elifndim==4:
weight=win.view(1, 1, 1, win.shape[-1])
ifs>=win.shape[-1]:
out=conv(out, weight=weight, stride=1, padding=0, groups=C)
else:
warnings.warn(
f"Skipping Gaussian Smoothing at dimension 2+{i} for input: {input.shape} and win size: {win.shape[-1]}"
)
returnout
Let me know,
The text was updated successfully, but these errors were encountered:
For 3d images was getting the error:
though weight was 4D? is this incorrect and requires and undate?
Let me know,
The text was updated successfully, but these errors were encountered: