import os
import sys
import numpy as np
import faiss
a = np.random.uniform(0,0.1,size=(100000,1024))
a = np.array( a, dtype = np.float32)
faiss_index = faiss.index_factory(a.shape[1], "IVF100,Flat")
faiss_index.train(a)
invlists = faiss.OnDiskInvertedLists(
faiss_index.nlist, faiss_index.code_size,
'test.ondisk')
faiss_index.replace_invlists( invlists )
faiss.write_index( faiss_index, "test_ondisk.faiss")
faiss_index = faiss.read_index( "test_ondisk.faiss" )
when OnDiskInvertedLists is empty , I write index.
It happen something wrong, when I read index again.
Traceback (most recent call last):
File "test.py", line 16, in <module>
faiss_index = faiss.read_index( "test_ondisk.faiss" )
RuntimeError: Error in void faiss::OnDiskInvertedLists::do_mmap() at OnDiskInvertedLists.cpp:243: Error: 'f' failed: could not open test.ondisk in mode r+: No such file or directory
when OnDiskInvertedLists is empty , I write index. It happen something wrong, when I read index again.
Summary
Platform
OS:
Faiss version:
Faiss compilation options:
Running on:
Interface:
Reproduction instructions