diff --git a/monai/metrics/hausdorff_distance.py b/monai/metrics/hausdorff_distance.py index 7644e52f83..51748c43c1 100644 --- a/monai/metrics/hausdorff_distance.py +++ b/monai/metrics/hausdorff_distance.py @@ -85,7 +85,7 @@ def _compute_tensor(self, y_pred: torch.Tensor, y: torch.Tensor): # type: ignor if not torch.all(y_pred.byte() == y_pred): warnings.warn("y_pred should be a binarized tensor.") if not torch.all(y.byte() == y): - raise ValueError("y should be a binarized tensor.") + warnings.warn("y should be a binarized tensor.") dims = y_pred.ndimension() if dims < 3: raise ValueError("y_pred should have at least three dimensions.") diff --git a/monai/metrics/meandice.py b/monai/metrics/meandice.py index f1e272bbe5..15635ff2d9 100644 --- a/monai/metrics/meandice.py +++ b/monai/metrics/meandice.py @@ -72,7 +72,7 @@ def _compute_tensor(self, y_pred: torch.Tensor, y: torch.Tensor): # type: ignor if not torch.all(y_pred.byte() == y_pred): warnings.warn("y_pred should be a binarized tensor.") if not torch.all(y.byte() == y): - raise ValueError("y should be a binarized tensor.") + warnings.warn("y should be a binarized tensor.") dims = y_pred.ndimension() if dims < 3: raise ValueError("y_pred should have at least three dimensions.") diff --git a/monai/metrics/surface_distance.py b/monai/metrics/surface_distance.py index 11b472185d..fce4b735e5 100644 --- a/monai/metrics/surface_distance.py +++ b/monai/metrics/surface_distance.py @@ -78,7 +78,7 @@ def _compute_tensor(self, y_pred: torch.Tensor, y: torch.Tensor): # type: ignor if not torch.all(y_pred.byte() == y_pred): warnings.warn("y_pred should be a binarized tensor.") if not torch.all(y.byte() == y): - raise ValueError("y should be a binarized tensor.") + warnings.warn("y should be a binarized tensor.") dims = y_pred.ndimension() if dims < 3: raise ValueError("y_pred should have at least three dimensions.")