Closed Simeng-Liu closed 1 year ago
The 1.15 onnxruntime training binaries are expected to go up on https://mvnrepository.com/artifact/com.microsoft.onnxruntime very soon (maybe a day or two).
Once these binaries are made available publicly, the libonnxruntime.so
and the corresponding header files can be extracted and used directly in the application.
In the meantime, you could build from source for Android by following the instructions listed out here: https://onnxruntime.ai/docs/build/training.html#build-instructions-for-the-training-phase.
Once you have your hands on the libonnxruntime.so
file and the header files, you must create a folder called libs (ORTPersonalize/app/src/main/cpp/libs
) and another folder called include/onnxruntime (ORTPersonalize/app/src/main/cpp/include/onnxruntime
) where the *.so
and the *.h
files can be respectively placed.
Once you do this, I believe your error will disappear. Please let me know if it does not.
You should also look out for a tutorial on https://onnxruntime.ai/docs/tutorials/ for this example. It is expected to land early next week. The tutorial will walk you through this example in a step-by-step fashion which (hopefully) will make the entire process very easy to follow.
Again, apologies for the lack of documentation. I will make sure that I add more context (in the tutorial) and details for others to follow along. Thanks for reporting this.
I just found that the binary was already published here: https://repo1.maven.org/maven2/com/microsoft/onnxruntime/onnxruntime-training-android/1.15.0/.
Here are steps to get the *.so
and the *.h
files:
onnxruntime-training-android-1.15.0.aar
file*.aar
to *.zip
.libonnxruntime.so
file can be found inside the jni/arm64-v8a
folderheaders
folder.Copy these over as highlighted in my previous comment. That should be all.
This is great! I will try it now. Also, I think issue #142 can be merged here.
I have tried the approach of extracting the onnxruntime-training-android-1.15.0.aar.
Then, I copy the libonnxruntime.so
file from the extracted file folder to the path /onnxruntime-training-examples/on_device_training/mobile/android/c-cpp/app/ORTPersonalize/app/src/main/cpp/libs/
. Now it works perfectly!
Thank you so much for your kindly help :)
Hi, I'm trying to run your Android example app ORTPersonalize. I met a problem below. The libortpersonalize.so is missing or built with failure in the building process. So the Cmake script didn't create the corresponding .so file successfully. I tried in my Linux and Windows system. Both of them failed with the same error message below. My cmake version is 3.26.4.
ninja: error: '/onnx/onnxruntime-training-examples/on_device_training/mobile/android/c-cpp/app/ORTPersonalize/app/src/main/cpp/libs/libonnxruntime.so', needed by '/onnx/onnxruntime-training-examples/on_device_training/mobile/android/c-cpp/app/ORTPersonalize/app/build/intermediates/cxx/Debug/5b237351/obj/arm64-v8a/libortpersonalize.so', missing and no known rule to make it