You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I will appreciate detailed instructions on how to set up OnnxRuntime on MacBook in order to resolve the issue described here.
Here is what I run into:
OrtModel will throw exception when running the test code OrtTest . This can be traced to the code snippet below.
ai.djl.repository.zoo.BaseModelLoader:
protected Model createModel(Path modelPath, String name, Device device, Block block, Map<String, Object> arguments, String engine) throws IOException {
Model model = Model.newInstance(name, device, engine);
...
}
OrtEngine.java:
public Model newModel(String name, Device device) {
return new OrtModel(name, this.newBaseManager(device), this.env);
}
The error message is java.lang.ExceptionInInitializerError
More information on what did and tried:
I did include OnnxRuntime 19.0 in my pom file, with both the djl onnnxruntime engine and the Microsoft onnx dependencies showing up in my IntelliJ IDE.
When running this piece of test code OrtTest.java (on my MacBook), I didn't see the native onnx libraries automatically downloaded or copied to directory .djl.ai, which would be the case for PyTorch.
I understand that the native libraries are packed in the Microsoft jar onnxruntime-1.12.1.jar. it didn't help at all when I manually unzipped and copied the native libraries to .djl.ai.
I've also noticed the inline comment within OrtTest.java about libgomp.so.1 and the path for OnnxRuntime.
This is the inline comment: "FIXME: Ort requires libgomp.so.1 pre-installed, we should manually copy libgomp.so.1 to our cache folder and set "onnxruntime.native." + library + ".path" to djl cache directory."
It would be better if an example is given to illustrate the meaning of [set "onnxruntime.native." + library + ".path" to djl cache directory.] Is this some OS env setting or something to be set programmatically?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am having difficulty running through the test code OrtTest at https://github.com/deepjavalibrary/djl/blob/master/engines/onnxruntime/onnxruntime-engine/src/test/java/ai/djl/onnxruntime/engine/OrtTest.java
I will appreciate detailed instructions on how to set up OnnxRuntime on MacBook in order to resolve the issue described here.
Here is what I run into:
OrtModel will throw exception when running the test code OrtTest . This can be traced to the code snippet below.
ai.djl.repository.zoo.BaseModelLoader:
protected Model createModel(Path modelPath, String name, Device device, Block block, Map<String, Object> arguments, String engine) throws IOException {
Model model = Model.newInstance(name, device, engine);
...
}
OrtEngine.java:
public Model newModel(String name, Device device) {
return new OrtModel(name, this.newBaseManager(device), this.env);
}
The error message is java.lang.ExceptionInInitializerError
More information on what did and tried:
I did include OnnxRuntime 19.0 in my pom file, with both the djl onnnxruntime engine and the Microsoft onnx dependencies showing up in my IntelliJ IDE.
When running this piece of test code OrtTest.java (on my MacBook), I didn't see the native onnx libraries automatically downloaded or copied to directory .djl.ai, which would be the case for PyTorch.
I understand that the native libraries are packed in the Microsoft jar onnxruntime-1.12.1.jar. it didn't help at all when I manually unzipped and copied the native libraries to .djl.ai.
I've also noticed the inline comment within OrtTest.java about libgomp.so.1 and the path for OnnxRuntime.
This is the inline comment: "FIXME: Ort requires libgomp.so.1 pre-installed, we should manually copy libgomp.so.1 to our cache folder and set "onnxruntime.native." + library + ".path" to djl cache directory."
It would be better if an example is given to illustrate the meaning of [set "onnxruntime.native." + library + ".path" to djl cache directory.] Is this some OS env setting or something to be set programmatically?
Beta Was this translation helpful? Give feedback.
All reactions