OpenCV Error: Bad argument [closed]
Hello , I have a problem.My compiler says : OpenCV Error: Bad argument (While cross-validation one or more of the classes have been fell out of the sample.
My response datas : labels(0, 0) = 1.000000 labels(1, 0) = -1.000000 labels(2, 0) = 1.000000 labels(3, 0) = -1.000000 labels(4, 0) = -1.000000 labels(5, 0) = 1.000000 labels(6, 0) = -1.000000 labels(7, 0) = 1.000000
http://code.opencv.org/issues/3194 This link says that this is a bug, but I am not clear.
SVM.train_auto(trainingDataMat, labels, Mat(), Mat(), params);
I change train method's name as train, the error is not occurred.
the default value for k_fold in train_auto is 10. that means, it wants to do a 10 fold crossvalidation, so you need at least 5 items per class. you only got 4 per class.
if you don't want the cross-validation, use the train() method.
ok, I understand , thank you...
Closing topic due to being solved!