Skip to content

ValueError: The number of classes has to be greater than one; got 1 #7

@tilltheworldend

Description

@tilltheworldend

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions