mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-25 19:48:11 +00:00
Update OnnxRuntime.java for OS X environment. (#3985)
onnxruntime init failure due to wrong path of reading native libraries. In OS X 64 system, the arch name is detected as x86 which generates invalid path to read native libraries. Exception java.lang.UnsatisfiedLinkError: no onnxruntime in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867) at java.lang.Runtime.loadLibrary0(Runtime.java:870) at java.lang.System.loadLibrary(System.java:1122) at ai.onnxruntime.OnnxRuntime.load(OnnxRuntime.java:174) at ai.onnxruntime.OnnxRuntime.init(OnnxRuntime.java:81) at ai.onnxruntime.OrtEnvironment.<clinit>(OrtEnvironment.java:24)
This commit is contained in:
parent
989fe2498f
commit
dbd5aab6d2
1 changed files with 1 additions and 1 deletions
|
|
@ -57,7 +57,7 @@ final class OnnxRuntime {
|
|||
}
|
||||
String detectedArch = null;
|
||||
String arch = System.getProperty("os.arch", "generic").toLowerCase(Locale.ENGLISH);
|
||||
if (arch.indexOf("amd64") == 0) {
|
||||
if (arch.indexOf("amd64") == 0 || arch.indexOf("x86_64") == 0) {
|
||||
detectedArch = "x64";
|
||||
} else if (arch.indexOf("x86") == 0) {
|
||||
detectedArch = "x86";
|
||||
|
|
|
|||
Loading…
Reference in a new issue