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
Hi, I'm facing difficulty in adding custom index (filename) to the IndexMap. The objective of the task is to add feature vectors for indexing and while searching the output should be filename rather than an ordinal index. The test code is:
def test_faiss():
d = 20
nb = 1
file_name = 'test.png'
xb = np.random.random((nb, d)).astype('float32')
ids = np.array(file_name).reshape(nb, 1)
index = faiss.IndexFlatL2(d)
index = faiss.IndexIDMap(index)
index.add_with_ids(xb, ids)
return
and, the error is:
assert ids.shape == (n, ), 'not same nb of vectors as ids'
AssertionError: not same nb of vectors as ids
I'm using only 1 vector for indexing, so my ids also has shape of (1, 1). Is there something missing or misunderstood?
The text was updated successfully, but these errors were encountered:
Hi, I'm facing difficulty in adding custom index (filename) to the IndexMap. The objective of the task is to add feature vectors for indexing and while searching the output should be filename rather than an ordinal index. The test code is:
and, the error is:
I'm using only 1 vector for indexing, so my
ids
also has shape of (1, 1). Is there something missing or misunderstood?The text was updated successfully, but these errors were encountered: