TensorFlowAndroidMNIST icon indicating copy to clipboard operation
TensorFlowAndroidMNIST copied to clipboard

android ndk api_level=9

Open InsightDev opened this issue 9 years ago • 4 comments

android_sdk_repository( name = "androidsdk", api_level = 23, build_tools_version = "23.0.1", path = "/home/gzzhang/android-sdk", )

android_ndk_repository( name="androidndk", path="/opt/android-ndk", api_level=9, << ==================== )

can you build the "tensorflow android libs" with android ndk api_level=9.

if you build them with android ndk api_level=21, the libs can't be used below android 5.0

because some functions can't been found.

SO, can you down the android ndk api_level to 9.


I have do something, but when invoke: tensorflow::NewSession(options)

and, it print message: Not found: Could not find session factory for DIRECT_SESSION

InsightDev avatar Apr 26 '16 14:04 InsightDev

Sorry I didn't notice your post and found it just now.

I tried to build with "api_level=9" & android-ndk-r10e, This error occurred.

INFO: From Compiling tensorflow/examples/android/jni/jni_utils.cc:
In file included from tensorflow/examples/android/jni/jni_utils.cc:33:0:
./tensorflow/examples/android/jni/limiting_file_input_stream.h: In member function 'virtual int tensorflow::android::LimitingFileInputStream::Read(void*, int)':
./tensorflow/examples/android/jni/limiting_file_input_stream.h:39:28: error: 'errno' was not declared in this scope
     } while (result < 0 && errno == EINTR);
                            ^
./tensorflow/examples/android/jni/limiting_file_input_stream.h:39:37: error: 'EINTR' was not declared in this scope
     } while (result < 0 && errno == EINTR);
                                     ^

Did you modify tensorflow source to pass building with api_level9?

miyosuda avatar May 09 '16 05:05 miyosuda

@miyosuda

The past few days, I have done something.

Because I want the libandroid_tensorflow_lib.a, so the android_demo is not importance for me.

I just comment out these: while (result < 0 && errno == EINTR)

then with android-ndk-r10e and api_level=9, the build is success.

After got the libandroid_tensorflow_lib.a, now I develop app under Windows with Android.mk and the libs.


Under Windows, Android-ndk-r10e is also needed, otherwise, it can't find session factory for DIRECT_SESSION.

“Not found: Could not find session factory for DIRECT_SESSION”

InsightDev avatar May 09 '16 05:05 InsightDev

@tiny-app Ah I see, the error code is from android sample, and not from library itself. OK.

I'll try.

miyosuda avatar May 09 '16 05:05 miyosuda

Hi, could you help me make this work on api=15? Thanks in advance :)

ChimneyCake avatar Sep 01 '17 11:09 ChimneyCake