-
Notifications
You must be signed in to change notification settings - Fork 736
Fix normalization #2130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix normalization #2130
Conversation
Ah I missed some things when saving the model. However I can already tell you it works much better if you rely on pred_scores for downstream tasks! |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2130 +/- ##
==========================================
+ Coverage 80.78% 80.83% +0.05%
==========================================
Files 248 248
Lines 10859 10876 +17
==========================================
+ Hits 8772 8792 +20
+ Misses 2087 2084 -3 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @alexriedel1! I only have super minor comments
Hello guys, With this commit, people that used to load a state dict with a model trained prior to this and has only the "normalization_metric" in state dict get the error bellow (in this case, using EfficientAd): AttributeError: 'EfficientAd' object has no attribute 'anomaly_maps_normalization_metrics' This is due to the fact that there was no difference in metrics normalization before and with the new fix, the attribute is not defined: (AnomalyModule -> load_state_dict: line 171) So, my question is: what should I do to fix this without retraining the model? |
The easiest would be to install the anomalib version you were using at the time of model training. |
📝 Description
Fixes: #2122 (reply in thread) and #2027 and #2139 (comment)
The normalization metrics are resetted before every validation. Is there any flaw in this logic or does it makes sense, so that models that have very different anomaly map and pred score magnitudes during training epochs are optimally normalized.
✨ Changes
Select what type of change your PR is:
✅ Checklist
Before you submit your pull request, please make sure you have completed the following steps:
For more information about code review checklists, see the Code Review Checklist.