hcw-00 / PatchCore_anomaly_detection

Unofficial implementation of PatchCore anomaly detection
Apache License 2.0
317 stars 93 forks source link

save model problem "AttributeError: Can't pickle local object 'STPM.__init__.<locals>.hook_t'" #5

Closed ghost closed 3 years ago

ghost commented 3 years ago

I'd like to save a model from training,
when I used torch. save(model, 'save_model_path.pt'), The following error occurred "AttributeError: Can't pickle local object 'STPM.init..hook_t' How can I save the model?

hcw-00 commented 3 years ago

Hi. I think there is no need to save the model. The model itself is from torch hub. We just use pre-trained model and does not update weights.