Skip to content
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

java.lang.UnsatisfiedLinkError when calling SVM.loadSVM() #638

Closed
yanhuixie opened this issue Mar 9, 2017 · 4 comments
Closed

java.lang.UnsatisfiedLinkError when calling SVM.loadSVM() #638

yanhuixie opened this issue Mar 9, 2017 · 4 comments
Labels

Comments

@yanhuixie
Copy link

yanhuixie commented Mar 9, 2017

java.lang.UnsatisfiedLinkError: org.bytedeco.javacpp.helper.opencv_ml$AbstractStatModel.loadSVM(Ljava/lang/String;Ljava/lang/String;)Lorg/bytedeco/javacpp/opencv_ml$SVM;
at org.bytedeco.javacpp.helper.opencv_ml$AbstractStatModel.loadSVM(Native Method)

Just simply calling SVM.loadSVM("/path/to/trained/svm.xml", "svm");
Everything (SVM train etc.) works normally but SVM.loadSVM().
Any suggestion is appreciated, thanks!

<dependency>
    <groupId>org.bytedeco</groupId>
    <artifactId>javacv-platform</artifactId>
    <version>1.3.1</version>
</dependency>
@yanhuixie
Copy link
Author

OK, it seems the problem is solved. You have to to call FileStorage.open() before SVM.loadSVM(). Is it true?

final String path = "/path/to/trained/svm.xml";
FileStorage fs = new FileStorage();
fs.open(path, CV_STORAGE_READ);
SVM.loadSVM(path, "svm");

@saudet saudet added the bug label Mar 9, 2017
@saudet
Copy link
Member

saudet commented Mar 9, 2017

There are a few Loader.load() calls missing from the helper classes. Thanks for pointing this out! To work around the issue for now, we can actually just call this before SVM.loadSVM():

Loader.load(org.bytedeco.javacpp.opencv_ml.class);

saudet added a commit to bytedeco/javacpp-presets that referenced this issue Mar 9, 2017
@yanhuixie
Copy link
Author

Wow~ Thanks for your precise reply, @saudet ! It works.

@saudet
Copy link
Member

saudet commented Mar 9, 2017

@saudet saudet closed this as completed Mar 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants