Error with trainAuto

asked 2015-10-29 13:39:00 -0600

Hi,

I get an error "Floating point exception: 8" when I use trainAuto using the following code. How can this error be resolved?

cv::Mat matFeatures(batch_size, dim_features, CV_32F, rgFeatures); cv::Mat matLabels(batch_size, 1, CV_32F, rgLabels);

cv::Ptr<cv::ml::SVM> svm = cv::ml::SVM::create();
svm->setType(cv::ml::SVM::C_SVC);
svm->setKernel(cv::ml::SVM::LINEAR);
svm->setGamma(3);
svm->setTermCriteria(cv::TermCriteria(cv::TermCriteria::MAX_ITER+cv::TermCriteria::EPS, 10000, 1e-6));

cv::Ptr<cv::ml::TrainData> tData = cv::ml::TrainData::create(matFeatures, cv::ml::ROW_SAMPLE, matLabels);

svm->trainAuto(tData, 2);

Regards, Vishnu

edit retag flag offensive close merge delete

Comments

1

hi, @Vishnu, there are a couple of issues with trainAuto() currently, but this seems to be a new one.

since there is nothing obviously wrong in the code (afaik) , it would be nice, to have some (smallish) dataset to test/reproduce the error.

also, the usual infos: os / bits / compiler / opencv version , please.

berak gravatar imageberak ( 2015-10-30 02:34:39 -0600 )edit