Comments (11)
Yes seems like this
https://github.com/spotify/annoy/blob/master/src/annoylib.h#L368
is not respected here:
https://github.com/spotify/annoy/blob/master/src/annoymodule.cc#L108
from annoy.
Thanks for your reply.
My own computer which is also ubuntu 14.04 works fun.
Any idea what I should do with Amazon EC2?
i.get_item_vector(..) always returns [0,0..]
from annoy.
hm get_item_vector shouldn't return 0... that's weird
from annoy.
it indeed is!
i.get_item_vector(18)
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
even i.get_nns_by_item(18, 10) works
But I need those vectors in my app
from annoy.
That's strange. Let me add a unit test and try to repro
from annoy.
I won't have time today unfortunately
from annoy.
@zhdeath can you post a snippet of code of how you're generating your annoy index, and how you're loading and using it?
the return value of load() isn't really of much consequence is it? I think it got changed to return 0 instead of true inadvertently to be more similar to POSIX return values, but it should still work.
from annoy.
Not able to reproduce...see #72
from annoy.
@a1k0n Worked on these trivial code with 1.2.2 or 1.3.1
from annoy import AnnoyIndex
import random
f = 30
a = AnnoyIndex(f) # length of item vector
n = 1000 # number of vector
for i in xrange(n):
v = []
for z in xrange(f):
v.append(random.gauss(0, 1))
a.add_item(i, v)
a.build(-1)
a.save('test.tree')
b = AnnoyIndex(f)
b.load('test.tree')
print(i.get_item_vector(10))
print(b.get_nns_by_item(10, 10))
load() returns false, get_item_vector returns [0,0...]; but get_nss_by_item(10,10) works fun. Python is 2.7.6
I think it's version related.
With 1.0.5, load() returns true and get_item_vector() also works
from annoy.
Hm it seems like the issue is some kind of integer casting.
The item vector looks like this for me:
[1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, -1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, -1, 0]
from annoy.
I pushed a breaking test to #72
Will now fix it
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.