Can‘t use customize metrics #2681
-
I was trying to use custom metrics Accuracy from torchmetrics:
However: So I tried another option in documentation:
But the error remained. So I added "task": An error occurred: I am a beginner and I wonder what did I missed? anomalib 2.1.0.dev0 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @Cua1103, I suggest using a more specific torchmetrics accuracy class. It looks like you want to use binary classification metric with AnomalibMetric
Can also be used with create_anomalib_metric
Let me know if this solves your question. |
Beta Was this translation helpful? Give feedback.
-
Thank you. That works. |
Beta Was this translation helpful? Give feedback.
Hi @Cua1103,
This is because the Accuracy class from torchmetrics uses new() instead of init() to create an object.
I suggest using a more specific torchmetrics accuracy class. It looks like you want to use binary classification metric with AnomalibMetric
Can also be used with create_anomalib_metric