Faiss: how to save IndexBinaryFlat on disk

Created on 21 Aug 2020  Â·  2Comments  Â·  Source: facebookresearch/faiss

when I try to save index by write_index()
I meet some problem

Traceback (most recent call last):
File "hamming.py", line 50, in
main()
File "hamming.py", line 43, in main
faiss.write_index(index, "./index_BinaryIVF_Hamming.index")
NotImplementedError: Wrong number or type of arguments for overloaded function 'write_index'.
Possible C/C++ prototypes are:
faiss::write_index(faiss::Index const *,char const *)
faiss::write_index(faiss::Index const *,FILE *)
faiss::write_index(faiss::Index const *,faiss::IOWriter *)

here is my code

index = faiss.IndexBinaryFlat(d)
    index.add(data)
    faiss.write_index(index, "./index_BinaryIVF_Hamming.index")

faiss-cpu:1.6.3
python:7.5

help wanted

Most helpful comment

To save binary indexes, use faiss.write_index_binary.

All 2 comments

To save binary indexes, use faiss.write_index_binary.

To save binary indexes, use faiss.write_index_binary.

thank you~

Was this page helpful?
0 / 5 - 0 ratings