问题描述
我尝试遵循 MUSE项目上的说明.
他们需要PyTorch和Faiss. PyTorch易于安装.但是我发现安装 Faiss 时遇到了问题.
They require PyTorch and Faiss. PyTorch is easy to install. But I found problem with installing Faiss.
关于MUSE的说明告诉我使用
The instruction on MUSE tell me to use
conda install faiss-cpu -c pytorch
但是Google Colab不支持conda
(当我尝试!pip install conda
时,它不起作用)
But Google Colab doesn't support conda
(When I tried !pip install conda
, it didn't work)
当我!pip install faiss
时,费斯也没有工作.
And Faiss didn't work when I !pip install faiss
either.
是否可以安装Faiss或conda?
Is there a way to install Faiss or conda?
推荐答案
这是我最终安装faiss的方式.
Here's how I eventually install faiss.
!wget https://anaconda.org/pytorch/faiss-cpu/1.2.1/download/linux-64/faiss-cpu-1.2.1-py36_cuda9.0.176_1.tar.bz2
!tar xvjf faiss-cpu-1.2.1-py36_cuda9.0.176_1.tar.bz2
!cp -r lib/python3.6/site-packages/* /usr/local/lib/python3.6/dist-packages/
!pip install mkl
然后,我可以import faiss
没问题.警告是我没有使用GPU.如果要使用GPU,则需要安装此软件:
Then, I can import faiss
with no problem. The warning is that I didn't use GPU. If you want to use GPU, you need to install this instead:
这篇关于在Google Colaboratory上安装faiss的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!