Skip to content

Dim error in HoVerNetLoss #5500

@KumoLiu

Description

@KumoLiu

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).

# 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))

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)

Metadata

Metadata

Assignees

Labels

Pathology/MicroscopyDigital Pathology and Microscopy related

Type

No type

Projects

Status

💯 Complete

Relationships

None yet

Development

No branches or pull requests

Issue actions