ClasswiseWrapper
double prefixes with self.prefix
when enclosed in a MetricCollection
#1915
Labels
ClasswiseWrapper
double prefixes with self.prefix
when enclosed in a MetricCollection
#1915
🐛 Bug
#1866 double prefixes with
self.prefix
when enclosed in aMetricCollection
. This is becauseMetricCollection
already handles prefixing, here:torchmetrics/src/torchmetrics/collections.py
Lines 335 to 339 in a448ad3
but #1866 doesn't account for it.
To Reproduce
Enclose a
ClasswiseWrapper
with aprefix
within aMetricCollection
.Finds a multiclass accuracy and a classwise f1 score.
Expected behavior
I should get
{'val/acc': tensor(0.), 'val/f1_Tree': tensor(0.), 'val/f1_Bush': tensor(0.)}
. I instead get{'val/acc': tensor(0.), 'val/f1_f1_Tree': tensor(0.), 'val/f1_f1_Bush': tensor(0.)}
.Environment
torchmetrics
1.0.0 viapip
3.10.6
& PyTorch1.12
:The text was updated successfully, but these errors were encountered: