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
input_format="index"
The generalized dice score does not work with 2D tensors of shape (N, L) and input_format="index".
(N, L)
import torch from torchmetrics.segmentation import GeneralizedDiceScore batch_size = 16 num_classes = 8 L = 100 y = torch.randint(num_classes, (batch_size, L)) pred = torch.randint(num_classes, (batch_size, L)) dice = GeneralizedDiceScore(num_classes=num_classes, input_format="index") dice(y, pred)
ValueError: Expected both `preds` and `target` to have at least 3 dimensions, but got 2.
According to the documentation, the dice score should work on tensors of shape (N, ...) with input_format="index":
(N, ...)
torchmetrics/src/torchmetrics/segmentation/generalized_dice.py
Lines 54 to 61 in 0a64b3f
The exception is coming from dice functional:
torchmetrics/src/torchmetrics/functional/segmentation/generalized_dice.py
Lines 55 to 56 in 0a64b3f
The text was updated successfully, but these errors were encountered:
Hi! thanks for your contribution!, great first issue!
Sorry, something went wrong.
Dice
GeneralizedDice
Successfully merging a pull request may close this issue.
🐛 Bug
The generalized dice score does not work with 2D tensors of shape
(N, L)
andinput_format="index"
.To Reproduce
Expected behavior
According to the documentation, the dice score should work on tensors of shape
(N, ...)
withinput_format="index"
:torchmetrics/src/torchmetrics/segmentation/generalized_dice.py
Lines 54 to 61 in 0a64b3f
Environment
Additional context
The exception is coming from dice functional:
torchmetrics/src/torchmetrics/functional/segmentation/generalized_dice.py
Lines 55 to 56 in 0a64b3f
The text was updated successfully, but these errors were encountered: