diff --git a/torchvision/ops/boxes.py b/torchvision/ops/boxes.py index f8d9c596606..8547383d34b 100644 --- a/torchvision/ops/boxes.py +++ b/torchvision/ops/boxes.py @@ -323,7 +323,7 @@ def masks_to_boxes(masks: torch.Tensor) -> torch.Tensor: bounding_boxes = torch.zeros((n, 4), device=masks.device, dtype=torch.float) for index, mask in enumerate(masks): - y, x = torch.where(masks[index] != 0) + y, x = torch.where(mask != 0) bounding_boxes[index, 0] = torch.min(x) bounding_boxes[index, 1] = torch.min(y) diff --git a/torchvision/ops/deform_conv.py b/torchvision/ops/deform_conv.py index 550f659b07d..f898f66f702 100644 --- a/torchvision/ops/deform_conv.py +++ b/torchvision/ops/deform_conv.py @@ -74,7 +74,7 @@ def deform_conv2d( pad_h, pad_w = _pair(padding) dil_h, dil_w = _pair(dilation) weights_h, weights_w = weight.shape[-2:] - _, n_in_channels, in_h, in_w = input.shape + _, n_in_channels, _, _ = input.shape n_offset_grps = offset.shape[1] // (2 * weights_h * weights_w) n_weight_grps = n_in_channels // weight.shape[1]