You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RuntimeError: Detected more unique values in preds than num_classes. Expected only 3 but found 4 in preds.
Expected behavior
I would expect that the validation does not complain about ignore_index in predictions - at least when it's only in places where target also has ignore_index. The computation of the metric is already correct in this case.
Environment
TorchMetrics version: 1.3.0.post0 (pip installed)
Python & PyTorch Version: 3.10 & 2.2.0
Any other relevant information such as OS: Ubuntu
Workarounds
set validate_args=False when initializing the metric
replace ignore_index with 0 in preds
The text was updated successfully, but these errors were encountered:
Borda
changed the title
Error during argument validation: predictions can not contain ignore_index
Error during argument validation: predictions can not contain ignore_indexMar 5, 2024
🐛 Bug
The validation of input arguments raises a RunTimeError if
ignore_index
appears in predictions.To Reproduce
Output:
Expected behavior
I would expect that the validation does not complain about
ignore_index
in predictions - at least when it's only in places where target also hasignore_index
. The computation of the metric is already correct in this case.Environment
Workarounds
validate_args=False
when initializing the metricignore_index
with 0 in predsThe text was updated successfully, but these errors were encountered: