-
Notifications
You must be signed in to change notification settings - Fork 105
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
Error on building for expert.py #6
Comments
Did you manage to figure out how to fix I tried copy and pasting the the |
I didn’t manage that problem. But it seems that we need to use freeze_graph.py from Tensorflow tools to create graph.pb file.
|
From the the replies from my issue at tensorflow/tensorflow#5585 at the Tensorflow GitHub, it seems like that the problem comes up because the Tensorflow used to generate the .PB-file is 0.11.0 whereas the Tensorflow version on Android is at 0.10.0. EDIT: I managed to fix the error. How I did it can be found at tensorflow/tensorflow#5585. |
if possible, could you send me a sample of your project? |
My internet is very slow (16kb/s upload) but I will upload my |
Here you can find my |
Thank you very much,
|
@leslietso May I ask you for a quick review on the steps you've performed to get the app built? I would also like to integrate a newer version of Tensorflow into my Android-Studio system. But I have absolutely no clue how I should proceed with building the new binaries and include directories.. Building the Demo-App and copying the .lo .o files is ok, but the files in the /include folder are still the old ones, right? Where can I find the new ones? Thanks :) |
Sorry for the late reply. I simply downloaded the newest repo from Tensorflow, built it, then copied the contents of "tensorflow/tensorflow" folder to the "jni/include/tensorflow" folder and the contents of "tensorflow/third_party" to "jni/include/tensorflow". I have little experience with Tensorflow and am in no way an expert so the "jni_build" file does end up very big (over 800MB) as it is not optimized and includes all files whether I need it or not. |
Ah. Great. Thanks! You built it using bazel, right? Because there is also a CMAKE version nowadays. |
@leslietso @huythach Hi all,I also have this issues--" Could not create Tensorflow Graph: Invalid argument: NodeDef mentions attr 'Tshape' not in Op<name=Reshape; signature=tensor:T, shape:int32 -> output:T; attr=T:type>; " Now tensorflow update to r1.0.I don't know how to build it to fit this issues.Can you help me? |
@leslietso Thanks for your share "jni-build".My app can run now.But I want to know that how to fix it.How to build tensorflow can get genfiles's file? |
Any solution so far? |
I succeeded on building beginner.py and expert.py to beginner-graph.pb and expert-graph.pb files to be used in the Android project. But when I replaced these files in the app/src/main/assets/ only beginner-graph.pb works, expert-graph.pb does not work.
Do you have any idea?
(I have modified file DigitDetector.java in lines 43 and 46 to use beginner-graph.pb and expert-graph.pb, respectively).
I copy the error log as follows:
10-21 10:43:13.357 28693-28693/jp.narr.tensorflowmnist W/linker: libtensorflow_mnist.so: unused DT entry: type 0x6ffffffe arg 0x1e9c
10-21 10:43:13.357 28693-28693/jp.narr.tensorflowmnist W/linker: libtensorflow_mnist.so: unused DT entry: type 0x6fffffff arg 0x3
10-21 10:43:13.739 28693-28693/jp.narr.tensorflowmnist I/native: tensorflow_jni.cc:62 Loading Tensorflow.
10-21 10:43:13.739 28693-28693/jp.narr.tensorflowmnist I/native: tensorflow_jni.cc:63 Making new SessionOptions.
10-21 10:43:13.739 28693-28693/jp.narr.tensorflowmnist I/native: tensorflow_jni.cc:67 Got config, 0 devices
10-21 10:43:13.744 28693-28693/jp.narr.tensorflowmnist I/native: tensorflow_jni.cc:69 Session created.
10-21 10:43:13.744 28693-28693/jp.narr.tensorflowmnist I/native: tensorflow_jni.cc:73 Graph created.
10-21 10:43:13.744 28693-28693/jp.narr.tensorflowmnist I/native: tensorflow_jni.cc:78 Acquired AssetManager.
10-21 10:43:13.744 28693-28693/jp.narr.tensorflowmnist I/native: tensorflow_jni.cc:80 Reading file to proto: file:///android_asset/expert-graph.pb
10-21 10:43:13.744 28693-28693/jp.narr.tensorflowmnist I/native: jni_utils.cc:120 Opening asset expert-graph.pb from disk with zero-copy.
10-21 10:43:13.764 28693-28693/jp.narr.tensorflowmnist I/native: tensorflow_jni.cc:84 Creating session.
10-21 10:43:13.779 28693-28693/jp.narr.tensorflowmnist E/native: tensorflow_jni.cc:89 Could not create Tensorflow Graph: Invalid argument: NodeDef mentions attr 'Tshape' not in Op<name=Reshape; signature=tensor:T, shape:int32 -> output:T; attr=T:type>; NodeDef: Reshape = Reshape[T=DT_FLOAT, Tshape=DT_INT32](input, Reshape/shape)
10-21 10:43:13.782 28693-28693/jp.narr.tensorflowmnist I/MainActivity: Detector setup failed
10-21 10:43:13.883 28693-28693/jp.narr.tensorflowmnist D/AndroidRuntime: Shutting down VM
10-21 10:43:13.884 28693-28693/jp.narr.tensorflowmnist E/AndroidRuntime: FATAL EXCEPTION: main
Process: jp.narr.tensorflowmnist, PID: 28693
java.lang.RuntimeException: Unable to resume activity {jp.narr.tensorflowmnist/jp.narr.tensorflowmnist.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void jp.narr.tensorflowmnist.DrawView.onResume()' on a null object reference
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3050)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3081)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2447)
at android.app.ActivityThread.access$800(ActivityThread.java:156)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1351)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:211)
at android.app.ActivityThread.main(ActivityThread.java:5373)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1020)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:815)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void jp.narr.tensorflowmnist.DrawView.onResume()' on a null object reference
at jp.narr.tensorflowmnist.MainActivity.onResume(MainActivity.java:84)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1262)
at android.app.Activity.performResume(Activity.java:6120)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3039)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3081)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2447)
at android.app.ActivityThread.access$800(ActivityThread.java:156)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1351)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:211)
at android.app.ActivityThread.main(ActivityThread.java:5373)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1020)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:815)
10-21 10:43:35.680 28693-28693/jp.narr.tensorflowmnist I/Process: Sending signal. PID: 28693 SIG: 9
The text was updated successfully, but these errors were encountered: