Open jrusbo opened 1 week ago
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
Hi, set "S" / "M" instead of "small" / "medium" in config.yaml file
This won't help as "S" or "M" are strings too..
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
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