-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Dim error in HoVerNetLoss #5500
Copy link
Copy link
Closed
Labels
Pathology/MicroscopyDigital Pathology and Microscopy relatedDigital Pathology and Microscopy related
Milestone
Description
Describe the bug
Since in SobelGradients , we need input with shape (C, H, W, [D]), but I find in HoVerNetLoss, it used shape with (B, H, W).
MONAI/monai/transforms/post/array.py
Lines 888 to 890 in 27362e4
| # Check/set spatial axes | |
| n_spatial_dims = image_tensor.ndim - 1 # excluding the channel dimension | |
| valid_spatial_axes = list(range(n_spatial_dims)) + list(range(-n_spatial_dims, 0)) |
MONAI/monai/apps/pathology/losses/hovernet_loss.py
Lines 69 to 72 in 27362e4
| result_h = self.sobel(torch.squeeze(image[:, 0], dim=1))[batch_size:] | |
| result_v = self.sobel(torch.squeeze(image[:, 1], dim=1))[:batch_size] | |
| return torch.cat([result_h[:, None, ...], result_v[:, None, ...]], dim=1) |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Pathology/MicroscopyDigital Pathology and Microscopy relatedDigital Pathology and Microscopy related
Type
Projects
Status
💯 Complete