-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error while reading model file #9
Comments
It seems that the model file produced by svm_train is not entirely correct: svm_type c_svc I have figured out that a line defining the label property is missing. Adding "label 0 1" or "label whatever" in the head of the file solves the problem. Can you say why svm_train did not produce the model file correctly? Independently of the string following "label", in svm_predict.java, prediction is either true or false, while target is either 1.0 or -1.0. Can you suggest how prediction and target can be aligned? Thanks again, |
sorry,your mail send to the wrong person... ------------------ 原始邮件 ------------------ 主题: Re: [jlibsvm] Error while reading model file (#9) It seems that the model file produced by svm_train is not entirely correct: svm_type c_svc I have figured out that a line defining the label property is missing. Adding "label 0 1" or "label whatever" in the head of the file solves the problem. Can you say why svm_train did not produce the model file correctly? Independently of the string following "label", in svm_predict.java, prediction is either true or false, while target is either 1.0 or -1.0. Can you suggest how prediction and target can be aligned? Thanks again, — |
Hi developers,
I am trying to run jlibsvm using the legacyexec programs svm_train and svm_predict. I have successfully run svm_train and produced a model file. Then, I provided this model file as the second attribute of svm_predict, but I get the following error.
Exception in thread "main" edu.berkeley.compbio.jlibsvm.SvmException: Unable to load file models/a2a.m
at edu.berkeley.compbio.jlibsvm.SolutionModel.identifyTypeAndLoad(SolutionModel.java:69)
at svm_predict.main(svm_predict.java:47)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at edu.berkeley.compbio.jlibsvm.SolutionModel.identifyTypeAndLoad(SolutionModel.java:59)
... 1 more
Caused by: java.lang.NullPointerException
at java.util.StringTokenizer.(StringTokenizer.java:199)
at java.util.StringTokenizer.(StringTokenizer.java:236)
at edu.berkeley.compbio.jlibsvm.binary.BinaryModel.(BinaryModel.java:133)
... 6 more
I think the problem lies in BinaryModel. I have tried versions 0.91 and 0.92, but I get the same error. I have also inspected the model file that is produced by svm_train and it seems perfectly logical.
Thanks in advance for your reply!
Yannis
The text was updated successfully, but these errors were encountered: