torchmetrics.F1
bug with ignore_index
and macro averaging
#486
Labels
torchmetrics.F1
bug with ignore_index
and macro averaging
#486
🐛 Bug
An error is raised while using
torchmetrics.F1
if:ignore_index
set to a valid class index (<num_classes
)To Reproduce
Run the following code:
The following error in raised in
torchmetrics/functional/classification/f_beta.py
:line 100, in _fbeta_compute num[ignore_index, ...] = -1 IndexError: index 2 is out of bounds for dimension 0 with size 2
Expected behavior
The result in the above example should be the same as the case with no
ignore_index
provided.Environment
1.8.1
3.6.12
0.5.0
The text was updated successfully, but these errors were encountered: