Skip to content

Commit

Permalink
🐞 Fix EfficientAD's pretrained weigths load path (#1966)
Browse files Browse the repository at this point in the history
Fix EfficientAD's pretrained weigths load path to be identical to downloaded path
  • Loading branch information
seyeon923 authored Apr 9, 2024
1 parent e077b1e commit 25fc952
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/anomalib/models/image/efficient_ad/lightning_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def prepare_pretrained_model(self) -> None:
if not (pretrained_models_dir / "efficientad_pretrained_weights").is_dir():
download_and_extract(pretrained_models_dir, WEIGHTS_DOWNLOAD_INFO)
teacher_path = (
pretrained_models_dir / "efficientad_pretrained_weights" / f"pretrained_teacher_{self.model_size}.pth"
pretrained_models_dir / "efficientad_pretrained_weights" / f"pretrained_teacher_{self.model_size.value}.pth"
)
logger.info(f"Load pretrained teacher model from {teacher_path}")
self.model.teacher.load_state_dict(torch.load(teacher_path, map_location=torch.device(self.device)))
Expand Down

0 comments on commit 25fc952

Please sign in to comment.