condaでfaissをinstallしましたがエラーが出ます
pythonにcondaでfaissをinstallしました。
import faissは通りました。
faissのチュートリアルを実装中に以下のエラーメッセージが発生しました。
発生している問題・エラーメッセージ
Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: module 'faiss' has no attribute 'IndexFlatL2'
該当のソースコード
python
1import faiss 2index = faiss.IndexFlatL2(d)
補足情報(FW/ツールのバージョンなど)
CUDAは8.0です。
チュートリアル:https://github.com/facebookresearch/faiss/wiki/Getting-started
OSはcentos 6.5です。GCC 4.4.7 20120313 (Red Hat 4.4.7-1)。
python version 3.5.3, anaconda2です。
インストール手法
conda install faiss-gpu -c pytorch # [DEFAULT]For CUDA8.0
print(faiss.file)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'faiss' has no attribute 'file'
エラーはトレースバックを含め全文を載せてください。もちろん実名など個人情報につながるものは伏せてしまっても構いません。
そうなんですね!追記しました。
print(faiss.__file__) してみるとどうなりますか?
Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: module 'faiss' has no attribute '__file__'
カレントディレクトリにfaissという名前のディレクトリがあったりしません?
それは無いですね...
なるほど。それならちょっと解決が面倒かもしれません。ご利用のOS、Pythonのバージョン、faissの具体的なインストール方法など、詳細な情報を追記した方が良いと思います。
なるほど... 他のインストール手法がいいのかもしれませんね
あなたの回答
tips
プレビュー