segmentation_models.pytorch
segmentation_models.pytorch copied to clipboard
Clarify Error Message for Condition Checking 'threshold' in metrics/functional.py
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.