Skip to content
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

Maybe not working in python3, intermitant "Caught exception: Unknown algorithm for choosing inital centers" error #11

Open
HenryDayHall opened this issue Jul 31, 2019 · 0 comments

Comments

@HenryDayHall
Copy link

HenryDayHall commented Jul 31, 2019

So I don't really know what I'm doing with this package, apologies if this is a error on my end. The error message "Caught exception: Unknown algorithm for choosing initial centers." seems to appear intermittently when trying to chose an algorithm with a string, and no matter what I put in the result is [0, 0].

I am using python 3.6.7 with ipython 7.1.1.

Here is an example;

testset = np.random.rand(1000, 128)
    ...: flann = pyflann.FLANN()
    ...: result, dists = flann.nn(
    ...:     dataset, testset, 5, algorithm="kmeans", branching=32, iterations=7, checks=16)
Caught exception: Unknown algorithm for choosing initial centers.   
#^^ Error here!!!!!!!

In [31]: dataset = np.random.rand(10000, 128)
    ...: testset = np.random.rand(1000, 128)
    ...: flann = pyflann.FLANN()
    ...: result, dists = flann.nn(
    ...:     dataset, testset, 5, algorithm=0, branching=32, iterations=7, checks=16)

In [32]: results
Out[32]: array([0, 0], dtype=int32)

In [33]: dataset = np.random.rand(10000, 128)
    ...: testset = np.random.rand(1000, 128)
    ...: flann = pyflann.FLANN()
    ...: result, dists = flann.nn(
    ...:     dataset, testset, 5, branching=32, iterations=7, checks=16)

In [34]: results
Out[34]: array([0, 0], dtype=int32)

In [35]: dataset = np.random.rand(10000, 128)
    ...: testset = np.random.rand(1000, 128)
    ...: flann = pyflann.FLANN()
    ...: result, dists = flann.nn(
    ...:     dataset, testset, 5, algorithm=0, branching=32, iterations=7, checks=16)

In [36]: dataset = np.random.rand(10000, 128)
    ...: testset = np.random.rand(1000, 128)
    ...: flann = pyflann.FLANN()
    ...: result, dists = flann.nn(
    ...:     dataset, testset, 5, algorithm="kmeans", branching=32, iterations=7, checks=16)
#^^ Same code no error!!!!!!!

In [37]: print(results)
[0 0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant