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

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() #16

Open
albertyou2 opened this issue Dec 23, 2016 · 0 comments

Comments

@albertyou2
Copy link

hi @mynameisfiber

when i had prepared my data and fit, I got an error:

[2016-12-23 16:04:08,914] INFO - fit:35: Fitting with k=15
[2016-12-23 16:04:13,686] INFO - fit:47: Splitting cluster 1 / 15 (k=0)
[2016-12-23 16:04:13,686] INFO - fit:55: Running secondary kmeans
/home/sojoyoo/image_clustering_japan/xmeans.py:135: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison
if centroids in ('kmeans++', 'random'):
Traceback (most recent call last):
File "clustering_kmeans.py", line 60, in
mxmt = XMeans(15, verbose=True).fit(data)
File "/home/sojoyoo/image_clustering_japan/xmeans.py", line 61, in fit
test_model = self._fit(2, points, np.asarray([new_point1, new_point2]))
File "/home/sojoyoo/image_clustering_japan/xmeans.py", line 146, in _fit
).fit(data[:])
File "/home/sojoyoo/image_clustering_japan/mini_batch.py", line 109, in fit
if self.init == 'random':
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

data shape is (157,4096),python is 2.7.
Do you have any idea to handle this?

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