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

TypeError: kmeans() got an unexpected keyword argument 'cluster_centers' #43

Open
Beluooo-H opened this issue Mar 12, 2024 · 1 comment

Comments

@Beluooo-H
Copy link

Beluooo-H commented Mar 12, 2024

x_batch size is [100,256,3,3], len(x_batch) is 400,I want to use these datas to get the cluster is 100 of kmeans. When it is not the first time, I want to choose the preview cluster_centers to retrain(According example). But I got the below error. What should I do? Thankes!
image

@elephanta-jx
Copy link

I had the same issue in my environment. My problem was that I installed the kmeans package via pip install kmeans-pytorch. For some reasons, the actual kmeans function in the package was a cpu version of kmeans_pytorch. It did not accept 'cluster_centers' argument. You can check the source code of your kmeans function and make sure it is the one shown on github. My fix was quite simple. What I did was using git to download the package and installed it locally.

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