Comments (8)
That's very strange; could you share the code you're using to generate and to use the indexes? When does it run out of memory -- when creating the index or after saving it and using it for ANN lookups?
How much memory does it use in your small test? It shouldn't be very much if it's only 500 items, even if they're 128 dimensional items.
Annoy definitely works under Linux (Debian or Ubuntu is what we use) and I thought it worked fine on OS X as well.
from annoy.
While stripping down the code to get a minimal working example, I found the actual cause of the problem.
I was generating quite long integers that I have used as identifiers (see https://gist.github.com/herrbuerger/5f22ee159d0df800c844). Once I had changed them back to smaller numbers, everything went smoothly.
Here is a minimal working script to reproduce the issue: https://gist.github.com/herrbuerger/e4452d55ffb03a53d423
from annoy.
I have found another issue regarding the identifiers, not sure this is related. If not, a separate issue would probably make sense:
https://gist.github.com/herrbuerger/6cbeada92901a282c957
If you check the output of the script, you will see that annoy shows identifiers which have never been used. Took me a while to catch this :)
from annoy.
We should probably couple Annoy with a hashtable so that you can put in arbitrary stuff. But yeah, until then, you will see those issues :(
from annoy.
I'm not sure if there is a fix to this – what do you suggest?
from annoy.
A hashtable would be great. This would definitely solve my problems.
Still, I have a working example with the integers now as well and the results look pretty good. However, I will have to create a lookup table, which will probably be a challenge itself depending on the number of items.
from annoy.
There's a lot of file-based fast hashtables, including Spotify's own: https://github.com/spotify/sparkey – other ones I'm aware of are bsddb and Tokyo Cabinet.
from annoy.
Closing this issue since it's not a "bug" per se – maybe the documentation should be more clear
from annoy.
Related Issues (20)
- Build parallalization is not working. HOT 2
- Support annoy index loading from binary index data
- How many trees should I use? HOT 2
- Memory Leak in Annoy (get_nns_by_vector)? HOT 8
- Annoy Object Not Pickle'able HOT 1
- Add sample weights to distance metric? HOT 3
- Source distribution not availabe for 1.17.2 version HOT 2
- Unable to inherit the AnnoyIndex class HOT 2
- doesn't work correctly if torch tensor is input. But also doesn't throw error. Pls add an assertion that this only takes np arrays not torch tensors HOT 2
- _Vector should use position-only parameter for the index HOT 3
- How do you reduce a vector to 2 coordinates HOT 1
- [Distance] What did I do wrong?
- [MSVC] Annoy failed to run test on Windows HOT 1
- Some segment faults HOT 1
- Regarding updating an existing ANNOY model HOT 2
- Anyone tried storing trees and nodes in DynamoDB? HOT 1
- Is there any workaround to be able to use the Chebyshev distance with this library? HOT 1
- from annoy import AnnoyIndex
- Annoy build failed in MSVC x86 mode
- Using a built Annoy tree in a different device HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from annoy.