-
Notifications
You must be signed in to change notification settings - Fork 457
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
pybind11.h not found when installing using pip #307
Comments
Interesting. I have an ubuntu 16.04 lts machine, and I've successfully installed nmslib using pip when pybind11 wasn't already installed. 'pip install nmslib' should install pybind11 if it isn't already installed - but in your case it looks like it pip thinks it was installed already ( What does |
This might be related to this issue: pybind/pybind11#1344 |
Sorry what I posted was a bit misleading. Initially when I tried $ python -c 'import pybind11; print(pybind11.get_include())'
include |
@benfred this is the issue I mentioned before. There seems to be a bug in python setup tools: it ignores requirements specs. |
hmm - so there might be two separate problems there (not installing pybind11 as part of the install, and not getting the correct path from pybind11 once it is installed). I think I've managed to replicate the problem here. It seems like the issue is with pybind11 and pip10 . With that combination the 'pybind11.get_include' returns just 'include' instead of the fully qualified path:
versus
|
@taketwo as a short term fix, trying going 'pip install pip==9.0.3' and then installing nmslib - longer term I think we will have to wait for a patched version of pybind11 @searchivarius I'll see if I can replicate this with the install_requires being ignored |
Thanks guys for your quick reaction. I installed May I squeeze in a small offtopic question? (Did not find a support forum or mailing list.) I have a relatively small cloud of 3D points (between 1K and 4K) and I need to repeat a lot of single nearest neighbor lookups as fast as possible (approximate results are okay). Which parameters (build/search time) are most relevant for me, what's your expert opinion? |
@taketwo it's hard to tell without looking at the data. However, for such a small collection, it can be hard to beat bruteforce search. How fast should be fast? How large are you vectors (dim)? |
@searchivarius My vectors have only 3 dimensions (points in Euclidean space), they are sampled from surfaces of object models. Ideally I'd like to keep each query around or under 1us, though I don't know how realistic is this. |
Hi @taketwo , I played with randomly generated 3d data. Your real data is likely to have lower retrieval times. I don't get 1us, but for 5K records I can get 700K queries per second on my 4-core laptops. Here is the command line that I used to test it:
Construction parameters are : |
Thanks @searchivarius, this is already quite reasonable. Perhaps I could bring the query time further down by exploring the parameter space around your suggestions. |
@taketwo yes, your results can certainly vary: random uniform data is a notoriously difficult even for lower dimensions. I would be curious to learn about your results. Thanks! |
@searchivarius M=30 is way to many for d=3. Probably M=3..6 would be much better choice |
@yurymalkov it wasn't in my test. |
I created a test set with actual data that I need to process (1K records and 1M queries). I'm using the With your suggested parameters it takes 2.1s. I tried to vary every option (separately) and was able to bring it down to 1.2s with:
This all is done with a single core, because in my application I will need to repeat such batch queries against many different indices, thus I will be parallelizing on that level. But for the record, increasing the number of threads, I see only marginal improvement. With 4 threads and best parameter set it takes 1.1s. |
Thanks for the update!
Do u use knnquerybatch?
Yes small M may work fast although accuracy can be compromised.
…On Wed, Apr 25, 2018, 5:47 PM Sergey Alexandrov ***@***.***> wrote:
I created a test set with actual data that I need to process (1K records
and 1M queries). I'm using the knnQueryBatch function in the python
interface and %timeit for benchmarking. As I wrote before, I only need to
find a single nearest neighbor for each query point.
With your suggested parameters it takes *2.1s*.
I tried to vary every option (separately) and was able to bring it down to
*1.2s* with:
- M = 2
- ef = 1
- rest are the same
This all is done with a single core, because in my application I will need
to repeat such batch queries against many different indices, thus I will be
parallelizing on that level. But for the record, increasing the number of
threads, I see only marginal improvement. With 4 threads and best parameter
set it takes *1.1s*.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#307 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAyZMlmTyoWgY42L0TYfIy7ZVzdX4Qiuks5tsO79gaJpZM4TihpD>
.
|
sorry I missed u mentioned knnquerybatch. |
Yes, my workstation has "Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz" and |
@taketwo hmmm this is strange. Did you try to explicitly set num_threads to say 6? |
Yes, I'm passing
There seem to be a sweet spot at 3 threads which I did not notice yesterday because I only tried some even numbers. |
@taketwo something is wrong :-( this is nearly perfectly parallelizable |
In the meantime I gave a try to a different ANN library which is designed specifically for low-dimensional spaces (libnabo), and it is dramatically faster, 26 ms for the same query. So I think for now I'll stick with that one. Thanks for your support! |
Good to know @taketwo thanks for testing. We never optimized for low-dimensional spaces, but there's clearly much to do. |
I'm trying to install python bindings on Ubuntu 16.04 machine:
Clearly,
pybind11
headers were not installed on my machine. This library is not packaged for apt-get (at least not for Ubuntu 16.04), so I needed to manually install from source.Would be nice if
nmslib
install script took care of this.The text was updated successfully, but these errors were encountered: