qubvel / segmentation_models.pytorch

Semantic segmentation models with 500+ pretrained convolutional and transformer-based backbones.
https://smp.readthedocs.io/
MIT License
9.1k stars 1.62k forks source link

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

Closed hxfdanger closed 4 months ago

hxfdanger commented 6 months ago

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.

github-actions[bot] commented 4 months ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 4 months ago

This issue was closed because it has been stalled for 7 days with no activity.