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
how to build tensorflow lite into a static c++ library using android ndk #14688
Comments
I recently managed to do this myself for armeabi-v7a. Here is what I had to do:
I made some other changes and added a file: |
@andrehentz could you please take a look. |
@shaurya0 [armeabi-v7a] Executable : test_tflite |
I've been able to build a binary that links to libtensorflow-lite.a within the tensorflow lite source tree and outside of it. Judging by the linker errors it looks like the problem is with how you are linking libstdc++. |
jus want to ask : can libtensorflow-lite.a do predictions only on android phones ? |
Can you please share the steps to build tflite static binary for android C++ |
I tried to follow the mentioned steps but I am getting an error:
I think this is a file generated by Bazel, is it required? These are the steps I followed, I am new to TFLite, so probably I am missing something.
|
Bazel should not be required and your are not missing anything :) Unfortunately we introduced a dependency to benchmark_model which isn't easily resolved with Make. The fix is #19019 |
I want to write a c++ code to run tensorflow models on android and ios. bothe of them support c++ API so I want a single file. tflite ot .pb file. can anybody help? |
@kargarisaac did you figure it out? What steps did you take? |
@kargarisaac Just to clarify: do you want a single .tflite file that can be interpreted both on android and ios? That should be possible. What's not working for you? Could you open a separate issue to track that? |
@andrehentz Do you have any C++ examples of Tensorflow Lite and Android NDK? |
The api doc describes how to write your C++ program to access a .tflite file and run inference. On android you will most likely need to interface with Java, which you can do via our own JNI code. If you prefer, TF Lite provides Java APIs too. |
@jefhai @andrehentz |
I want to write some c++ test binary using tensorflow lite.
from the README.md I can only see how to build the demo app.
Could you please tell me how to build tensorflow lite into a static library using android ndk?
The text was updated successfully, but these errors were encountered: