error while saving model with svm [closed]

asked 2017-12-04 08:10:23 -0500

AhmedSh3ban gravatar image

i am trying to implement svm but every time i try to save the model after training it says.

OpenCV Error: Parsing error (SVM model data is invalid, check sv_count, var_* and class_count tags) in write, file /home/pixar/Downloads/OpenCV/modules/ml/src/svm.cpp, line 2038 terminate called after throwing an instance of 'cv::Exception' what(): /home/pixar/Downloads/OpenCV/modules/ml/src/svm.cpp:2038: error: (-212) SVM model data is invalid, check sv_count, var_* and class_count tags in function write

here is my code. https://ideone.com/8uXuXV

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by berak
close date 2017-12-04 10:58:48.954175

Comments

i didn't. i just want to save the features .

AhmedSh3ban gravatar imageAhmedSh3ban ( 2017-12-04 08:39:30 -0500 )edit
1

the error will go away, once you have more than 1 sample ...

berak gravatar imageberak ( 2017-12-04 08:44:41 -0500 )edit

Thanks. you were right everything is fine now

AhmedSh3ban gravatar imageAhmedSh3ban ( 2017-12-04 10:12:13 -0500 )edit