Lightning-AI / torchmetrics

Machine learning metrics for distributed, scalable PyTorch applications.
https://lightning.ai/docs/torchmetrics/
Apache License 2.0
2.15k stars 410 forks source link

Dice: The `ignore_index` 255 is not valid for inputs with 6 classes #2849

Open robmarkcole opened 3 days ago

robmarkcole commented 3 days ago

🐛 Bug

6 classes, ignore index 255 and

Dice(
    num_classes=num_classes,
    ignore_index=ignore_index,
    average="micro",
)

Error

  - The `ignore_index` 255 is not valid for inputs with 6 classes

Similar to https://github.com/Lightning-AI/torchmetrics/issues/304

Borda commented 3 days ago

is it with the latest version? and if you could provide full example with sample values

robmarkcole commented 3 days ago

With torchmetrics==1.6.0