You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am getting a "segmentation fault" error which is crashing the python interpreter when using IDSelectorNot to exclude some IDs from the search() results. See below for a script to reproduce the issue.
Please let me know if I am doing something incorrectly - thanks!
Platform
OS: macOS 13.5 (Ventura) / Apple Silicon
Faiss version: 1.7.4
Installed from: conda / python 3.11
Faiss compilation options: n/a
Running on:
CPU
GPU
Interface:
C++
Python
Reproduction instructions
importfaissimportnumpyasnpprint(f'faiss version: {faiss.__version__}')
vecs=np.random.rand(10000, 50).astype(np.float32)
vecs_normalized=np.copy(vecs)
faiss.normalize_L2(vecs_normalized)
index_faiss=faiss.IndexHNSWFlat(vecs_normalized.shape[1], 32, faiss.METRIC_INNER_PRODUCT)
index_faiss.add(vecs_normalized)
query_vec=vecs_normalized[0].reshape(1, -1)
top_k=20# this works finecos_sims, idx_results=index_faiss.search(query_vec, top_k)
print(f'base idx_results: {idx_results}')
# this also works fineparams_include=faiss.SearchParametersHNSW(sel=faiss.IDSelectorBatch([3195, 1935]))
cos_sims, idx_results=index_faiss.search(query_vec, top_k, params=params_include)
print(f'params_include idx_results: {idx_results}')
# Error: "segmentation fault" when calling search()params_exclude=faiss.SearchParametersHNSW(sel=faiss.IDSelectorNot(faiss.IDSelectorBatch([3195, 1935])))
cos_sims, idx_results=index_faiss.search(query_vec, top_k, params=params_exclude)
print(f'params_exclude idx_results: {idx_results}')
The text was updated successfully, but these errors were encountered:
Summary
I am getting a "segmentation fault" error which is crashing the python interpreter when using
IDSelectorNot
to exclude some IDs from thesearch()
results. See below for a script to reproduce the issue.Please let me know if I am doing something incorrectly - thanks!
Platform
OS: macOS 13.5 (Ventura) / Apple Silicon
Faiss version: 1.7.4
Installed from: conda / python 3.11
Faiss compilation options: n/a
Running on:
Interface:
Reproduction instructions
The text was updated successfully, but these errors were encountered: