nmslib / hnswlib

Header-only C++/python library for fast approximate nearest neighbors
https://github.com/nmslib/hnswlib
Apache License 2.0
4.11k stars 607 forks source link

Loaded index query error #555

Open ClaudeHu opened 2 months ago

ClaudeHu commented 2 months ago

I installed latest version of hnswlib (0.8.0) and had two hnswlib.Index loaded from .bin files. They both contain same number of vectors (9138), and have same values of ef (10) and M (16). However, when run knn_query() with k=9138, one index work while the other one gave this error even after reset ef to 9138:

RuntimeError: Cannot return the results in a contiguous 2D array. Probably ef or M is too small