-
Notifications
You must be signed in to change notification settings - Fork 652
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
[Bug]: Issue with self.model_size
Initialization in EfficientAD
Class
#2157
Comments
If I see it correctly this change would fix the issue: model_size_str = self.model_size.value if isinstance(self.model_size, EfficientAdModelSize) else self.model_size
teacher_path = (
pretrained_models_dir / "efficientad_pretrained_weights" / f"pretrained_teacher_{model_size_str}.pth"
) I think it would be cleaner to cast the param into the enum on init, this would also make the type hinting more intuitive. |
Hi, set "S" / "M" instead of "small" / "medium" in config.yaml file |
This won't help as "S" or "M" are strings too.. |
Totally, I misunderstood the Issue key question, sorry |
thanks for merging |
Describe the bug
I encountered an issue while using the
EfficientAD
class in the Anomalib library. Theself.model_size
attribute is set to a string value ("small" or "medium") during initialization. This leads to a problem when theprepare_pretrained_model
function is called, specifically at the line whereself.model_size.value
is accessed, since a string object has novalue
attribute.Dataset
Folder
Model
Other (please specify in the field below)
Steps to reproduce the behavior
EfficientAD
class using theget_model
function inside the `src/anomalib/models/init.pyfit
function of the engineOS information
OS information:
Expected behavior
self.model_size
should be initialized as an instance ofEfficientAdModelSize
rather than a plain string. This will ensure that thevalue
attribute is accessible.I think it should look like this:
Logs
Code of Conduct
The text was updated successfully, but these errors were encountered: