Skip to content
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 the library for API Level 19 ?? #5

Open
alan23273850 opened this issue Aug 9, 2016 · 5 comments
Open

How to build the library for API Level 19 ?? #5

alan23273850 opened this issue Aug 9, 2016 · 5 comments

Comments

@alan23273850
Copy link

Hi! I am a freshman developer to JNI and may I ask you a question about this?? I want to build this project on my android phone with API Level 19. I just modified APP_PLATFORM := android-21 to APP_PLATFORM := android-19 in Application.mk. However, it could not find the definition of errno. And after adding android-21 include path, the error becomes

..../armeabi-v7a/libandroid_tensorflow_lib_lite.lo(arena.o):arena.cc:function GLOBAL__sub_I_arena.cc: error: undefined reference to 'getpagesize'
..../libandroid_tensorflow_lib_lite.lo(numbers.o):numbers.cc:function tensorflow::strings::safe_strtof(char const
, float_): error: undefined reference to 'strtof'

Therefore I think binary libraries in TensorFlowAndroidMNIST/jni-build/jni/libs/armeabi-v7a/ can only be used in android-21 level. So my question is where did you find these binary libraries?? By directly copying from the official tensorflow project or rebuilding from the source?? How could I rebuild the source codes to generate the same libraries supporting android-19??

Sorry for my poor English and thank you in advance!!

@miyosuda
Copy link
Owner

miyosuda commented Aug 11, 2016

Sorry for late in reply.

I used to extract .a and .lo library files from tensorflow's original android demo by building with bazel.
First, I built Tensorflow r0.8's Android demo with following this instruction using bezel.

https://github.com/tensorflow/tensorflow/tree/master/tensorflow/examples/android/

After that I extracted .a and .lo files from "bazel-out" dir.

I haven't tried yet, but if you would like to change supporting android version, you can change it in WORKSPACE file.

https://github.com/tensorflow/tensorflow/blob/r0.8/WORKSPACE#L13

@AnjaConev
Copy link

I have the same issue. Did you menage to solve it?

@alan23273850
Copy link
Author

alan23273850 commented Sep 1, 2017

Nope, after that I have tried lots of cross combinations of Android SDK version and JNI version, and all of them failed. I forget some details because this issue has been for a long time. The only thing I can guarantee is that the procedure is very complicated.

This may be a non-solvable issue because tensorflow was invented after API Level 19 and it is certain that the developers did not consider the backward compatibility. In addition, most smartphones' API levels are beyond 19, so maybe ignoring these old versions is a necessary evil.

Of course, anyone who indeed solves this problem is very very welcome!!!

@AnjaConev
Copy link

Do you have experience with any other machine learning libraries that do work on API 19 that you would suggest?

@alan23273850
Copy link
Author

After googling for a while, I have found a good material: https://en.wikipedia.org/wiki/Weka_(machine_learning).
It is also an ML software in Java, and has Android version recently. Although I have not tried it before, I guess it can run on Android 4.4 because of its history. Hope it helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants