Why IndexIVFFlat search empty invlist? #2964
Unanswered
Kyungmin-Yu
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I used IndexIVFFlat to search for 11 nearest items, and the result included -1.
Since the dataset size is (60,100) and I used n_list=45 & n_probe=15, I expected to get full result.
Therefore, I invested which cell was searched by this code.
quantizer = faiss.indexFlatL2(100)
index = faiss.IndexIVFFlat(quantizer, 100, 45)
index.train(vectors)
index.add_with_ids(vectors, ids)
index.nprobe = 15
D,I = index.extract_index_ivf(index).quantizer.search(query, 15)
invlists = index.invlists
[invlists.list_size(int(c)) for c in I[0]]
It turns out that index inspected cells that contains 0 items.
I wonder why there is some cells that is empty, and why is IndexIVFFlat selected this cell to search.
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions