amazon-science / patchcore-inspection

Apache License 2.0
779 stars 154 forks source link

Faiss-GPU module commented out in the requirements.txt and can't be downloaded via pip. #92

Open AhmedHamadto opened 11 months ago

AhmedHamadto commented 11 months ago

I am trying to run the sample_training.sh, firstly I was greeted with the --log online error in the code, which I removed from the sample_training.sh file. After which running the sample_training.sh produces the error "AttributeError: module 'faiss' has no attribute 'GpuIndexFlatL2'. Did you mean: 'IndexFlatL2'?"

I saw that an issue had been opened on this before and the solution was to uninstall both faiss-cpu and faiss-gpu and install faiss-gpu.

However, the faiss-gpu is commented out in the requirements.txt file and pip says that no suitable version was found.

rovodanica commented 10 months ago

Hi, I faced the same error. Uninstalling both faiss-cpu and faiss-gpu and then reinstalling faiss-gpu worked for me.

If it still did not work for you: I'm not sure this will solve your problem, but this is how I created a working environment:

  1. install python==3.8
  2. install from requirements.txt (you could uncomment faiss-gpu and move it in front of faiss-cpu, although i did not test if this solves the problem)
  3. install timm, ipykernel
  4. unintall faiss-gpu and faiss-cpu
  5. install faiss-gpu
georgestanley commented 9 months ago

@AhmedHamadto You can install it from here instead https://github.com/facebookresearch/faiss/blob/main/INSTALL.md

DHAiRYA2048 commented 9 months ago

I faced the same error, I downgraded my python from 3.12 to 3.10 and it worked fine.