Faiss: error when run faiss.Kmeans

Created on 12 Apr 2019  路  3Comments  路  Source: facebookresearch/faiss

hello guys, I install cpu only faiss by conda , 'conda install faiss-cpu -c pytorch'
when I run

ncentroids = 1024
niter = 20
verbose = True
d = x.shape[1]
kmeans = faiss.Kmeans(d, ncentroids, niter, verbose)
kmeans.train(x)

in wiki : https://github.com/facebookresearch/faiss/wiki/Faiss-building-blocks:-clustering,-PCA,-quantization
I got following errors:
TypeError: __init__() takes 3 positional arguments but 5 were given in

kmeans = faiss.Kmeans(d, ncentroids, niter, verbose)

any suggestions?

question

Most helpful comment

The doc needs to be updated. You should replace

kmeans = faiss.Kmeans(d, ncentroids, niter, verbose)

with

kmeans = faiss.Kmeans(d, ncentroids, niter=niter, verbose=verbose)

All 3 comments

The doc needs to be updated. You should replace

kmeans = faiss.Kmeans(d, ncentroids, niter, verbose)

with

kmeans = faiss.Kmeans(d, ncentroids, niter=niter, verbose=verbose)

Fixed.

Thx @beauby

Was this page helpful?
0 / 5 - 0 ratings

Related issues

siva2k16 picture siva2k16  路  3Comments

zoe-cheung picture zoe-cheung  路  3Comments

lukedeo picture lukedeo  路  3Comments

minjiaz picture minjiaz  路  3Comments

cherryPotter picture cherryPotter  路  3Comments