Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

SVM model fails to load!

$
0
0
Hello, I trained an SVM model and save it in xml file, everythink look good. but when I load the model I print the getvar vaule its equal to 0? The model file looks fine to me?3C_SVCLINEAR1.0000000000000001e-011.1920928955078125e-0710004096221
i
1 2
1<_> -6.66133815e-15 -4.88498131e-15 -3.33066907e-15 -3.33066907e-15 0. This is a part of the train code : Ptr Model = ml::SVM::create(); Ptr TrainData = ml::TrainData::create(Data, ml::ROW_SAMPLE, Label); Model->setType(SVM); Model->setKernel(Kernel); Model->trainAuto(TrainData,5); Model->save((*path)); Test part in other project : Ptr classifier = ml::SVM::create(); classifier->load(*modelPath); Mat features = (*featuresSptr)[i]; features.convertTo(features, CV_32F); float label = classifier->predict(features); error : > OpenCV Error: Assertion failed> (samples.cols == var_count &&> samples.type() == CV_32F) in predict

Viewing all articles
Browse latest Browse all 19555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>