amazon-science / patchcore-inspection

Apache License 2.0
719 stars 146 forks source link

AttributeError: module 'faiss' has no attribute 'GpuIndexFlatL2' #30

Closed ez615 closed 2 years ago

ez615 commented 2 years ago

I use GPU. Both faiss-cpu and faiss-gpu is installed. (Using pip install -r requirements.txt) Why do I get this error?

File "/home/synapse/simulator/backend/patchcore_model/src/patchcore/common.py", line 45, in _create_index return faiss.GpuIndexFlatL2( AttributeError: module 'faiss' has no attribute 'GpuIndexFlatL2'

ez615 commented 2 years ago

This error seems to be an error caused by not recognizing faiss-gpu when the faiss-cpu version was installed first. So

  1. Uninstall both faiss-gpu and faiss-cpu
  2. Install faiss-gpu and solved.