Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Error while saving trained SVM in OpenCV 3.2.0 Java

when I try to save my trained SVM into file, I get the following error:

Caused by: java.lang.Exception: unknown exception
at org.opencv.core.Algorithm.save_0(Native Method)
at org.opencv.core.Algorithm.save(Algorithm.java:53)
at signdetectiontool.training.Trainer.createTrainingFile(Trainer.java:275)
at signdetectiontool.controller.MainController.trainNetworkAction(MainController.java:372)
... 58 more

I am using OpenCV 3.2.0 Java version. Has anyone encountered such problem? I am pretty sure that my SVM is well trained, because train method returned "true" and also predicting with it seems to work well. Are there any known solutions/workarounds for this problem?

Saving looks like any other examples:

svmClassifier.save("svmdata.xml");