-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add_with_ids not implemented for this type of index #1212
Comments
add_with_ids is not supported for Flat indexes. |
thx for your replay. |
i have test some other binary index, in binary wiki, add_with_ids was not implemented。 sorry, write_index_binary is ok.. |
@foocker Open CV feature vectors such as surf and sift have been extracted. How to use faiss for vector index? Do you have any reference cases? Thank you! |
Problem:
RuntimeError: Error in virtual void faiss::IndexBinary::add_with_ids(faiss::IndexBinary::idx_t, const uint8_t*, const idx_t*) at IndexBinary.cpp:35: add_with_ids not implemented for this type of index
Running on:
Interface:
Reproduction instructions
simple code as follows:
index = faiss.IndexBinaryFlat(dimensions*8) #dimensions=32
features = []
ids = []
ids_count =0
for loop:
ret, feature = way_feature(way, file_name) # eg, cv2.ORB_create()...
ids_list = np.linspace(ids_count, ids_count, num=feature.shape[0], dtype="int64")
features.append(feature)
ids.append(ids_list)
features = np.vstack(features)
ids = np.hstack(ids)
if features.any():
if not index.is_trained:
index.train(features)
index.add_with_ids(features, ids) # change
The text was updated successfully, but these errors were encountered: