We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I believe the bugfix #1386 introduced aother bug when computing MulticlassJaccardIndex.
MulticlassJaccardIndex
This bug appears when num_classes == ignore_index.
num_classes == ignore_index
import torch from torchmetrics.classification import MulticlassJaccardIndex target = torch.tensor([2, 1, 0, 0]) preds = torch.tensor([2, 1, 0, 1]) metric = MulticlassJaccardIndex(num_classes=3, ignore_index=3) metric(preds, target) print(metric.confmat) print(metric.compute())
results in:
IndexError: index 3 is out of bounds for dimension 0 with size 3
setting ignore_index == num_classes should work
ignore_index == num_classes
pip show torchmetrics Name: torchmetrics Version: 0.11.4
Fix: https://github.com/Lightning-AI/torchmetrics/pull/1860/files
The text was updated successfully, but these errors were encountered:
Hi! thanks for your contribution!, great first issue!
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
🐛 Bug
I believe the bugfix #1386 introduced aother bug when computing
MulticlassJaccardIndex
.This bug appears when
num_classes == ignore_index
.To Reproduce
Code sample
results in:
IndexError: index 3 is out of bounds for dimension 0 with size 3
Expected behavior
setting
ignore_index == num_classes
should workEnvironment
Fix: https://github.com/Lightning-AI/torchmetrics/pull/1860/files
The text was updated successfully, but these errors were encountered: