Closed cjrh closed 1 year ago
Note the results are the same if zero_based_numbering
is set to True.
Thank you for your feedback. I was able to reproduce the issue you mentioned. However, it will take a little while to fix it, because of its complicated situation.
I have integrated this change to ngt-rs
(on master branch), however it looks like there is still an issue with Lorenz
and SparseJaccard
as I get the following error:
cargo test
test ngt::index::tests::test_dist_sparse_jaccard ... FAILED
test ngt::index::tests::test_dist_lorentz ... FAILED
failures:
---- ngt::index::tests::test_dist_sparse_jaccard stdout ----
Error: Error("Capi : ngt_insert_index_as_float() : Error: /home/rgd/dev/projects/ngt-rs/ngt-sys/NGT/lib/NGT/ObjectRepository.h:allocatePersistentObject:345: ObjectSpace::allocatePersistentObject: Fatal error! The dimensionality is invalid. The specified dimensionality=3. The specified object=2.")
---- ngt::index::tests::test_dist_lorentz stdout ----
thread 'ngt::index::tests::test_dist_lorentz' panicked at src/ngt/index.rs:728:23:
index out of bounds: the len is 0 but the index is 0
These two distances are different from other distances. When using distances, the given vector data must follow the specific manners for the two distances. You may want you to remove the two distances from your test.
Thanks for the precision, I have removed them from the test and released the fix.
Thanks everyone 👏🏼
Summary
When calling
index.remove(<id>)
, an error occurs, but only with the following distance types:I first reported this bug on the ngt-rs project, but following comments by @lerouxrgd I decided to make a reproducer here. Note that since the same errors occur on that project, it is impossible that the error is in the Python wrapper.
Reproducer
Here is a small file to reproduce the error. To setup the venv and install deps:
These are the versions I have installed in my venv:
To run the file below, simply:
Here is the file below. The important part is the function
run_test()
.This produces the following output:
Comments
Normalized Cosine