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
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I want to use IndexHNSWFlat.search_level_0 in python, but some issues are encountered.
My code snippet is as follows:
import numpy as np
import faiss
index = faiss.read_index(hnsw_index_file, 0)
xq = np.random.normal(0, 1, [3, 128])
nearest = np.array([ [0], [0], [0] ], dtype=np.int32)
nearest_d = np.array([ [1000.0], [1000.0], [1000.0] ], dtype=np.float32)
distances = np.zeros(3, dtype=np.float32).reshape(3, 1)
labels = np.zeros(3, dtype=np.int64).reshape(3, 1)
res = index.search_level_0(n=3, x=xq, k=1, nearest=faiss.swig_ptr(nearest), nearest_d=faiss.swig_ptr(nearest_d), distances=faiss.swig_ptr(distances), labels=faiss.swig_ptr(labels))
The error is: TypeError: Wrong number or type of arguments for overloaded function 'IndexHNSW_search_level_0'.
So, How can the arguments be passed to the function? Thanks~
Beta Was this translation helpful? Give feedback.
All reactions