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

Python example api error #22

Closed
Geek0x0 opened this issue Mar 7, 2017 · 2 comments
Closed

Python example api error #22

Geek0x0 opened this issue Mar 7, 2017 · 2 comments

Comments

@Geek0x0
Copy link

Geek0x0 commented Mar 7, 2017

I encountered some problems while running the python example

CaydynMacbookPro:faiss caydyn$ python python/demo_auto_tune.py
load data
load GT
prepare criterion
Traceback (most recent call last):
File "python/demo_auto_tune.py", line 73, in
crit.set_groundtruth(None, gt)
File "/Users/caydyn/Development/faiss/python/swigfaiss.py", line 2053, in set_groundtruth
def set_groundtruth(self, *args): return _swigfaiss.AutoTuneCriterion_set_groundtruth(self, *args)
TypeError: AutoTuneCriterion_set_groundtruth() takes exactly 4 arguments (3 given)

CaydynMacbookPro:faiss caydyn$ python ./python/demo_ivfpq.py
loading database
Traceback (most recent call last):
File "./python/demo_ivfpq.py", line 43, in
gt_index.add(xb)
File "/Users/caydyn/Development/faiss/python/swigfaiss.py", line 1143, in add
def add(self, *args): return _swigfaiss.IndexFlat_add(self, *args)
TypeError: IndexFlat_add() takes exactly 3 arguments (2 given)

How to deal with such mistakes?

@mdouze
Copy link
Contributor

mdouze commented Mar 7, 2017

Hi

This seems to be related to the SWIG wrapper. Could you check which swig version you are using?

swig -version

then restore the machine-generated files from the ones provided in the repo, see

https://github.com/facebookresearch/faiss/wiki/Troubleshooting#swig-error

@Geek0x0
Copy link
Author

Geek0x0 commented Mar 8, 2017

Sorry i was wrong, i used the wrong file

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

2 participants