Open jmnian opened 8 months ago
Hey, thank you for flagging!
There seems to be a lot of these issues with faiss
and faiss-gpu
on PyPi. The root issue being that the latest faiss-gpu wheels on there are aging and not well supported anymore.
The only surefire workaround currently seems to be to make sure they're all uninstalled (pip uninstall faiss-cpu
pip uninstall faiss
pip uninstall faiss-gpu
until there's nothing to uninstall) and then installing faiss-gpu
with one of the two officially supported ways: either building from source or installing via conda
, as detailed here.
We're looking on transitioning further and further away from faiss
due to those quirks and many others, but right now I'm afraid I can't provide a better solution!
Does this problem still exist?
Does this problem still exist?
It's still existing. I faced it today and solved with remove all faiss version and install the conda one from the official repo:
# CPU-only version
$ conda install -c pytorch faiss-cpu=1.8.0
# GPU(+CPU) version
$ conda install -c pytorch -c nvidia faiss-gpu=1.8.0
# GPU(+CPU) version with NVIDIA RAFT
$ conda install -c pytorch -c nvidia -c rapidsai -c conda-forge faiss-gpu-raft=1.8.0
I encountered this issue when I was trying to index colbert-ir/colbertv2.0:
WARNING! You have a GPU available, but only
faiss-cpuis currently installed. This means that indexing will be slow. To make use of your GPU. Please install
faiss-gpuby running: pip uninstall --y faiss-cpu & pip install faiss-gpu
I then run the pip command to uninstall faiss-cpu and install faiss-gpu. Then I got module not found:
File "/WAVE/users/unix/jnian/.local/lib/python3.9/site-packages/ragatouille/models/colbert.py", line 313, in index import faiss ModuleNotFoundError: No module named 'faiss'