amazon-science / patchcore-inspection

Apache License 2.0
680 stars 142 forks source link

auroc score is highly dependent on version of faiss #49

Open YoojLee opened 1 year ago

YoojLee commented 1 year ago

Hi, I was trying to reproduce the results of patchcore experiments.

At first, I tried the latest version of faiss-gpu (which is 1.7.2). But, it raises an Error as the picture below

image

so, I downgraded the version of faiss-gpu to 1.6.3 since this error appears to be due to the version of faiss (referring to https://github.com/facebookresearch/faiss/issues/2064#issue-1005708370)

However, this throws the weird score, which is way lower than the reported.

image

I was able to get the performance same as reported after I downgraded faiss-gpu to 1.5.3 which is equal to the latest version of faiss currently.

image

I guess there might be a huge difference between the latest version and the past version (1.5.3) in the manner faiss calculate the similarity or something. It would be much easier to reproduce the patchcore if you specify the version of faiss and faiss-gpu for the reproduction of patchcore in the requirements.txt!

wahyurahmaniar commented 1 year ago

Thank you

YoojLee commented 1 year ago

@wahyurahmaniar Well now the support for pip installation of faiss-gpu is not available (for the version > 1.5.3). For python version higher than 3.8, pip installation of 1.5.3 version of faiss-gpu is no longer supported. So, for the users with python >= 3.8, please install faiss with conda as instructed in the official faiss repository! Thanks.

aallgeier commented 7 months ago

Thanks for the helpful comment!

lynnchan333 commented 2 months ago

Thanks for your help, but unfortunately my use of conda install faiss-gpu==1.5.3 always showed incompatibility, so I found another solution (referring to https://github.com/facebookresearch/faiss/issues/2064 )which provided by Vikmary :

It helped her to install a specific wheel with faiss-gpu==1.7.3 :

pip install https://github.com/kyamagu/faiss-wheels/releases/download/v1.7.3/faiss_gpu-1.7.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

And then I was able to get the performance same as reported.

I hope it's useful.