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
Leading to AttributeError. (see attached logs, and code to reproduce)
I believe that to fix this, the assignment should be done inside the if statement. If my understanding of everything here is correct, these keys are either all in the dict or neither of them are, leading to a fix along the following lines:
The model can still be loaded from the checkpoint, even if normalization was not used
Screenshots
No response
Pip/GitHub
GitHub
What version/branch did you use?
1.2.0dev
Configuration YAML
/
Logs
File "C:\Code\anomalib\src\anomalib\models\components\base\anomaly_module.py", line 180, in load_state_dict
"anomaly_maps": self.anomaly_maps_normalization_metrics,
File "C:\Users\blazr\miniconda3\envs\anomalib_env_v1\lib\site-packages\torch\nn\modules\module.py", line 1709, in __getattr__
raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'")
AttributeError: 'Padim' object has no attribute 'anomaly_maps_normalization_metrics'
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
Describe the bug
With the latest update from #2130 (Thanks for the fix @alexriedel1 😄) the loading of model that was trained without normalization metrics doesn't work.
The attributes from these lines here:
https://github.com/openvinotoolkit/anomalib/blob/2bd2842ec33c6eedb351d53cf1a1082069ff69dc/src/anomalib/models/components/base/anomaly_module.py#L180-L182
are not set if the conditions above them are not met:
https://github.com/openvinotoolkit/anomalib/blob/2bd2842ec33c6eedb351d53cf1a1082069ff69dc/src/anomalib/models/components/base/anomaly_module.py#L171-L176
Leading to AttributeError. (see attached logs, and code to reproduce)
I believe that to fix this, the assignment should be done inside the if statement. If my understanding of everything here is correct, these keys are either all in the dict or neither of them are, leading to a fix along the following lines:
@alexriedel1 what do you think?
Dataset
MVTec
Model
PADiM
Steps to reproduce the behavior
OS information
OS information:
Expected behavior
The model can still be loaded from the checkpoint, even if normalization was not used
Screenshots
No response
Pip/GitHub
GitHub
What version/branch did you use?
1.2.0dev
Configuration YAML
/
Logs
Code of Conduct
The text was updated successfully, but these errors were encountered: