segmentation_models.pytorch icon indicating copy to clipboard operation
segmentation_models.pytorch copied to clipboard

Clarify Error Message for Condition Checking 'threshold' in metrics/functional.py

Open hxfdanger opened this issue 1 year ago • 0 comments

Issue Description:

Code Location: metrics/functional.py

Problem:

In the file functional.py, specifically in the the function get_stats, the line:

if torch.is_floating_point(output) and threshold is None:
    raise ValueError(f"Output should be one of the integer types if ``threshold`` is not None, got {output.dtype}.")

The current error message might cause confusion due to its wording related to the condition of threshold. As per the logic, the error should occur when threshold is None, but the error message doesn't accurately convey this condition.

hxfdanger avatar Dec 22 '23 13:12 hxfdanger