Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

SVM save/load problems

Hi all,

I'm currently working with am SVM in OpenCV 3.0.0. When I train a C_SVC-SVM with RBF kernel I'll get good classification results of about 90-95%. These results are really good, in the problem case I'm working on.

Now I save the SVM to a file (in my case I use YML, but I think it doesn't matter):

classifier->save(filename);

... where classifier is of type cv::Ptr<cv::ml::svm>. The next time I start the program, I'll load the SVM again:

classifier = cv::Algorithm::load<cv::ml::svm &gt;(filename);<="" p="">

... but now I get recognition rates of 0-36% with exactly the same dataset.

I dumped all parameters, the decision function, and all other values to console and compared them manually. Except for the support vector indices of the decision function they do not differ before save, after load, and in comparison to the saved files.

What's going on here? Any ideas?

Cheers, Jens