Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module 'faiss' has no attribute 'IndexFlatIP' (faiss sources) #23

Open
dmrost opened this issue Aug 23, 2018 · 1 comment
Open

module 'faiss' has no attribute 'IndexFlatIP' (faiss sources) #23

dmrost opened this issue Aug 23, 2018 · 1 comment

Comments

@dmrost
Copy link

dmrost commented Aug 23, 2018

OS: ubuntu 16.04 (Docker)

Reproduction instructions

I install sensegram:

git clone https://github.com/tudarmstadt-lt/sensegram.git
make
cd sensegram
pip3 install -r requirements.txt
python3 -m spacy download en

is fine.
Then install faiss like in Makefile:

apt-get update
apt-get install swig libopenblas-dev python-dev gcc g++ python3-pip unzip
rm -rf faiss
git clone https://github.com/facebookresearch/faiss.git
cd faiss
./configure
make -j$(nproc)
apt install curl
make test
make py

Finished - ok, but with little warning: "unused variable"
https://pastebin.com/5qHG7Ja7

then i run train-wikipedia-sample

cd ..
wget http://panchenko.me/data/joint/corpora/wiki.txt.gz -P model
bash train.sh model/wiki.txt.gz

error:

2018-08-23 16:17:00,775 : INFO : loading projection weights from model/wiki.txt.gz.cbow1-size100-window5-iter3-mincount10-bigramsFalse.word_vectors
2018-08-23 16:17:25,271 : INFO : loaded (123754, 100) matrix from model/wiki.txt.gz.cbow1-size100-window5-iter3-mincount10-bigramsFalse.word_vectors
2018-08-23 16:17:25,271 : INFO : precomputing L2-norms of word weight vectors
Traceback (most recent call last):
  File "train.py", line 114, in <module>
    main()
  File "train.py", line 82, in main
    compute_graph_of_related_words(vectors_fpath, neighbours_fpath, neighbors=args.N)
  File "/usr/software/sensegram/word_graph.py", line 10, in compute_graph_of_related_words
    index, w2v = build_vector_index(vectors_fpath)
  File "/usr/software/sensegram/word_graph.py", line 18, in build_vector_index
    index = faiss.IndexFlatIP(w2v.vector_size)
AttributeError: module 'faiss' has no attribute 'IndexFlatIP'
@kevin-meng
Copy link

trg to install mkl
and then install faiss-cpu

pip install mkl
pip install faiss-cpu

it works for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants