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 number of classes has to be greater than one; got 1 #7

Open
tilltheworldend opened this issue Aug 22, 2018 · 0 comments

Comments

@tilltheworldend
Copy link

Hello,
When try to run the code,I meet the error like followings:
('Calculating descriptos. Number of images is', 5)
('Training GMM of size', 5)
(5, 514)
(5,)
Traceback (most recent call last):
File "pyFisherVector.py", line 146, in
classifier = train(gmm, fisher_features)
File "pyFisherVector.py", line 116, in train
clf.fit(X, Y)
File "/usr/local/lib/python2.7/dist-packages/sklearn/svm/base.py", line 150, in fit
y = self._validate_targets(y)
File "/usr/local/lib/python2.7/dist-packages/sklearn/svm/base.py", line 506, in _validate_targets
% len(cls))
ValueError: The number of classes has to be greater than one; got 1

I just put 5 images in a folder,I have printed Y is (0,0,0,0,0).Is it the reason why show the error that the number of classes just got 1?If you know how to solve this problem,could you share with me?Thanks!

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