在Google Colaboratory上安装faiss [英] Installing faiss on Google Colaboratory

查看:385
本文介绍了在Google Colaboratory上安装faiss的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试遵循 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:

https://anaconda.org/pytorch/faiss-gpu/1.2.1/download/linux-64/faiss-gpu-1.2.1-py36_cuda9.0.176_1.tar.bz2

这篇关于在Google Colaboratory上安装faiss的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆