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?
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
Most helpful comment
The doc needs to be updated. You should replace
with