-
Notifications
You must be signed in to change notification settings - Fork 350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiclass Classification: assert num_classes >=2 #2205
Comments
Not to completely derail what should otherwise be a simple fix, but... This brings up the question of how we want to handle different forms of classification/semantic segmentation:
Torchmetrics originally had a single class for We should decide whether we want We could definitely still add such an assertion for now and change it to |
As you point out, binary etc are args torchmetrics accepts, so I think it makes sense to have this functionality with the existing task |
Just waiting for clarity on whether torchmetrics is planning on supporting the old metrics forever before deciding, but I was leaning towards that too. |
Looks like I misinterpreted, both are supported. Is there anything special we need to do in our trainers to support binary and multilabel, or do we literally just need to pass different |
Summary
Both segmentation and object detection require that the background be included and there is currently a note on these args:
num_classes: Number of prediction classes (including the background)
. Considering every dataaset must have at least 1 class, the min value of num_classes is 2. I propose adding an assertion, to prevent people (like myself!) from forgetting this and settingnum_classes=1
for datasets with a single class.Rationale
This config error has happened to me several times, and can pass silently
Implementation
I suppose we add validation to the BaseTask init
Alternatives
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: