hcw-00 / PatchCore_anomaly_detection

Unofficial implementation of PatchCore anomaly detection
Apache License 2.0
320 stars 92 forks source link

Error in test mode after faiss implementation #37

Open HoseinHashemi opened 2 years ago

HoseinHashemi commented 2 years ago

Has anybody tried the code in the test mode after faiss implementation? I believe that the line below needs to be added to the on_test_start method.

self.embedding_dir_path, self.sample_path, self.source_code_save_path = prep_dirs(self.logger.log_dir)

Otherwise, you'll get the error below:

AttributeError: 'STPM' object has no attribute 'embedding_dir_path'

And that makes sense because the attributes are not assigned yet, instead they are assigned after this point and also in on_train_start.

mjack3 commented 2 years ago

Yes, it need to be added.

mjack3 commented 2 years ago

Morevoer i can see a performance decay after faiss implementacion. I noticed that using the commit after e4cb4ba the performance is worst

hcw-00 commented 2 years ago

@HoseinHashemi error occurred in test mode is fixed. please check https://github.com/hcw-00/PatchCore_anomaly_detection/issues/51

Has anybody tried the code in the test mode after faiss implementation? I believe that the line below needs to be added to the on_test_start method.

self.embedding_dir_path, self.sample_path, self.source_code_save_path = prep_dirs(self.logger.log_dir)

Otherwise, you'll get the error below:

AttributeError: 'STPM' object has no attribute 'embedding_dir_path'

And that makes sense because the attributes are not assigned yet, instead they are assigned after this point and also in on_train_start.

hcw-00 commented 2 years ago

Morevoer i can see a performance decay after faiss implementacion. I noticed that using the commit after e4cb4ba the performance is worst

Hello. I didn't know that. I'll check. Thanks

mjack3 commented 2 years ago

Hello, that is because I installed FAISS using pip but conda works fine