onnxruntime: Problems with predictions on MacBook Air with M1 chip in Java project based on Maven
I have the following problem:
I’m using ONNX runtime in version 1.8.1 in the Java project with Maven.
When I invoke:
final OrtEnvironment environment = OrtEnvironment.getEnvironment();
then I get an error:
java.lang.NoClassDefFoundError: Could not initialize class ai.onnxruntime.OrtEnvironment
and I cannot perform prediction.
It works fine on Linux on different distros, but I have problems with executing it on MacBook Air with M1 chip.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 21 (13 by maintainers)
@Craigacp @snnn I compiled onnxruntime on my Macbook with the command
./build.sh --build_javaand in thejava/build/libs/onnxruntime-1.11.0.jarinside this*.jarfile, inai/onnxruntime/native/osx-arm64/directory there are fileslibonnxruntime.dylibandlibonnxruntime4j_jni.dylib, so according to your comments, this*.jarshould work with java projects on Macbook with M1 chip. Nevertheless, I haven’t tried to add this custom*.jarfile to my project yet. I’ll check it later.