0

I've been playing with metrics in pytorch ignite and have come across an issue with passing ignite objects to other ignite objects, for instance this code

cm = metrics.ConfusionMatrix(10)
cm.reset()
cm.update((y_pred, y_true_sparse))
print(cm.compute())
dice = metrics.DiceCoefficient(cm)
print(dice.compute())

throws ignite.exceptions.NotComputableError: Confusion matrix must have at least one example before it can be computed. even tho the confusion matrix does not fail. The same problem occurred when I tried computing the F beta score (passing precision and recall objects). I've tried some experiments, such as not computing the confusion matrix before passing it down or updating the data again but without success.

What am I doing wrong? This behaviour seems weird to me, even diving into the documentation I can't seem to figure it out and no relatable google search results come up.

Dominik Ficek
  • 138
  • 11

0 Answers0