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

Android App Crash On Start #280

Closed
astellato opened this issue Nov 18, 2015 · 3 comments
Closed

Android App Crash On Start #280

astellato opened this issue Nov 18, 2015 · 3 comments
Assignees

Comments

@astellato
Copy link

After building and installing an apk with bazel mobile-install, the Android application crashes on start. Occurs on both a Nexus 10 and a Nexus 9 on 5.1.1.

LOGCAT:

11-18 12:53:53.614 427-28083/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=org.tensorflow.demo/.CameraActivity (has extras)} from uid 10012 on display 0
11-18 12:53:53.671 427-1019/? I/ActivityManager: Start proc 1947:org.tensorflow.demo/u0a113 for activity org.tensorflow.demo/.CameraActivity
11-18 12:53:53.935 1963-1963/? I/dex2oat: /system/bin/dex2oat --runtime-arg -classpath --runtime-arg --instruction-set=arm --instruction-set-features=div --runtime-arg -Xrelocate --boot-image=/system/framework/boot.art --dex-file=/data/local/tmp/incrementaldeployment/org.tensorflow.demo/dex/incremental_classes1.dex --oat-fd=23 --oat-location=/data/data/org.tensorflow.demo/cache/incremental_classes1.dex --runtime-arg -Xms64m --runtime-arg -Xmx512m
11-18 12:53:54.114 1947-1947/org.tensorflow.demo W/linker: libtensorflow_demo.so: unused DT entry: type 0x1d arg 0x1159c7e
11-18 12:53:54.170 1947-1969/org.tensorflow.demo D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
11-18 12:53:54.177 1947-1947/org.tensorflow.demo D/Atlas: Validating map...
11-18 12:53:54.218 1947-1969/org.tensorflow.demo I/OpenGLRenderer: Initialized EGL, version 1.4
11-18 12:53:54.231 1947-1969/org.tensorflow.demo D/OpenGLRenderer: Enabling debug mode 0
11-18 12:53:54.234 1947-1969/org.tensorflow.demo D/mali_winsys: new_window_surface returns 0x3000
11-18 12:53:54.263 1947-1947/org.tensorflow.demo I/CameraManagerGlobal: getCameraService: Reconnecting to camera service
11-18 12:53:54.298 1947-1947/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Adding size: 1440x1080
11-18 12:53:54.298 1947-1947/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Adding size: 1440x960
11-18 12:53:54.298 1947-1947/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Adding size: 1280x1024
11-18 12:53:54.298 1947-1947/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Adding size: 1280x720
11-18 12:53:54.298 1947-1947/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Adding size: 960x720
11-18 12:53:54.298 1947-1947/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Adding size: 768x576
11-18 12:53:54.298 1947-1947/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Adding size: 720x576
11-18 12:53:54.298 1947-1947/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Adding size: 800x480
11-18 12:53:54.298 1947-1947/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Adding size: 720x480
11-18 12:53:54.298 1947-1947/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Adding size: 640x480
11-18 12:53:54.298 1947-1947/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Not adding size: 352x288
11-18 12:53:54.298 1947-1947/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Not adding size: 320x240
11-18 12:53:54.298 1947-1947/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Not adding size: 240x160
11-18 12:53:54.298 1947-1947/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Not adding size: 176x144
11-18 12:53:54.298 1947-1947/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Not adding size: 128x96
11-18 12:53:54.298 1947-1947/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Chosen size: 640x480
11-18 12:53:54.305 1947-1947/org.tensorflow.demo I/CameraManager: Using legacy camera HAL.
11-18 12:53:54.350 130-887/? I/Camera2ClientBase: Camera 0: Opened. Client: org.tensorflow.demo (PID 1947, UID 10113)
11-18 12:53:54.550 1947-1968/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Opening camera preview: 640x480
11-18 12:53:54.555 1947-1968/org.tensorflow.demo I/CameraDeviceState: Legacy camera service transitioning to state CONFIGURING
11-18 12:53:54.556 1947-1996/org.tensorflow.demo I/RequestThread-0: Configure outputs: 3 surfaces configured.
11-18 12:53:54.556 1947-1996/org.tensorflow.demo D/Camera: app passed NULL surface
11-18 12:53:54.568 1947-1998/org.tensorflow.demo D/mali_winsys: new_window_surface returns 0x3000
11-18 12:53:54.624 427-459/? I/ActivityManager: Displayed org.tensorflow.demo/.CameraActivity: +981ms
11-18 12:53:54.673 1947-1968/org.tensorflow.demo I/CameraDeviceState: Legacy camera service transitioning to state IDLE
11-18 12:53:54.676 1947-1968/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Getting assets.
11-18 12:53:54.677 1947-1968/org.tensorflow.demo I/native: tensorflow/examples/android/jni/tensorflow_jni.cc:51 Loading Tensorflow.
11-18 12:53:54.677 1947-1968/org.tensorflow.demo I/native: tensorflow/examples/android/jni/tensorflow_jni.cc:53 Making new SessionOptions.
11-18 12:53:54.677 1947-1968/org.tensorflow.demo I/native: tensorflow/examples/android/jni/tensorflow_jni.cc:56 Got config, 0 devices
11-18 12:53:54.678 427-459/? I/WindowManager: Screen frozen for +948ms due to Window{259ea1a0 u0 Starting org.tensorflow.demo}
11-18 12:53:54.679 1947-1968/org.tensorflow.demo I/native: tensorflow/core/common_runtime/local_device.cc:25 Local device intra op parallelism threads: 4
11-18 12:53:54.684 1947-1968/org.tensorflow.demo I/native: tensorflow/core/common_runtime/direct_session.cc:45 Direct session inter op parallelism threads: 4
11-18 12:53:54.691 1947-1968/org.tensorflow.demo I/native: tensorflow/examples/android/jni/tensorflow_jni.cc:59 Session created.
11-18 12:53:54.691 1947-1968/org.tensorflow.demo I/native: tensorflow/examples/android/jni/tensorflow_jni.cc:62 Graph created.
11-18 12:53:54.692 1947-1968/org.tensorflow.demo I/native: tensorflow/examples/android/jni/tensorflow_jni.cc:66 Acquired AssetManager.
11-18 12:53:54.692 1947-1968/org.tensorflow.demo I/native: tensorflow/examples/android/jni/tensorflow_jni.cc:68 Reading file to proto: file:///android_asset/tensorflow_inception_graph.pb
11-18 12:53:54.693 1947-1968/org.tensorflow.demo I/native: tensorflow/examples/android/jni/jni_utils.cc:85 Opening asset tensorflow_inception_graph.pb from disk with zero-copy.
11-18 12:53:54.709 1947-1968/org.tensorflow.demo A/native: tensorflow/examples/android/jni/jni_utils.cc:90 Check failed: message->ParseFromZeroCopyStream(&lis)
11-18 12:53:54.710 1947-1968/org.tensorflow.demo A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 1968 (CameraBackgroun)
11-18 12:53:54.820 128-128/? I/DEBUG: pid: 1947, tid: 1968, name: CameraBackgroun >>> org.tensorflow.demo <<<
11-18 12:53:54.867 128-128/? W/debuggerd: type=1400 audit(0.0:100): avc: denied { search } for name="org.tensorflow.demo" dev="mmcblk0p9" ino=97888 scontext=u:r:debuggerd:s0 tcontext=u:object_r:app_data_file:s0 tclass=dir permissive=0
11-18 12:53:54.867 128-128/? W/debuggerd: type=1400 audit(0.0:101): avc: denied { search } for name="org.tensorflow.demo" dev="mmcblk0p9" ino=97888 scontext=u:r:debuggerd:s0 tcontext=u:object_r:app_data_file:s0 tclass=dir permissive=0
11-18 12:53:54.872 128-128/? W/debuggerd: type=1400 audit(0.0:102): avc: denied { search } for name="org.tensorflow.demo" dev="mmcblk0p9" ino=97888 scontext=u:r:debuggerd:s0 tcontext=u:object_r:app_data_file:s0 tclass=dir permissive=0
11-18 12:53:54.883 128-128/? I/DEBUG: Abort message: 'tensorflow/examples/android/jni/jni_utils.cc:90 Check failed: message->ParseFromZeroCopyStream(&lis) '
11-18 12:53:54.889 128-128/? I/DEBUG: #5 pc 01c026a8 /data/app/org.tensorflow.demo-1/lib/arm/libtensorflow_demo.so (tensorflow::internal::LogMessage::GenerateLogMessage()+432)
11-18 12:53:54.889 128-128/? I/DEBUG: #6 pc 01c02b78 /data/app/org.tensorflow.demo-1/lib/arm/libtensorflow_demo.so (tensorflow::internal::LogMessageFatal::~LogMessageFatal()+80)
11-18 12:53:54.889 128-128/? I/DEBUG: #7 pc 0139e8d4 /data/app/org.tensorflow.demo-1/lib/arm/libtensorflow_demo.so (ReadFileToProto(AAssetManager_, char const_, google::protobuf::MessageLite*)+752)
11-18 12:53:54.889 128-128/? I/DEBUG: #8 pc 013a1ffc /data/app/org.tensorflow.demo-1/lib/arm/libtensorflow_demo.so (Java_org_tensorflow_demo_TensorflowClassifier_initializeTensorflow+1016)
11-18 12:53:54.889 128-128/? I/DEBUG: #9 pc 0000419d /data/data/org.tensorflow.demo/cache/incremental_classes1.dex
11-18 12:53:56.039 427-2007/? W/ActivityManager: Force finishing activity 1 org.tensorflow.demo/.CameraActivity

@andrewharp
Copy link
Contributor

Unfortunately due to the large filesize the model file assets are no longer included in the git repo, but must be downloaded and installed separately.

Additional steps required (also in readme):
$ wget https://storage.googleapis.com/download.tensorflow.org/models/inception5h.zip -O tensorflow/examples/android/assets/inception5h.zip
$ unzip tensorflow/examples/android/assets/inception5h.zip -d tensorflow/examples/android/assets/

I'm working on a fix to have this done automatically, but it will require an update to Bazel so that new_http_archive works properly with android_binary assets.

@andrewharp
Copy link
Contributor

To improve on the instructions above, you should delete the zip after extracting (or download it somewhere else in the first place) so that the resulting APK does not also bundle it.

@astellato
Copy link
Author

Had unzipped the file with the inception5h directory present in the assets folder. Instructions above fix the issue.

tensorflow-copybara pushed a commit that referenced this issue Nov 28, 2019
This addresses issue #270. Linalg is updated to take the same form
of iterator_types than vector contraction.

Closes #280

COPYBARA_INTEGRATE_REVIEW=tensorflow/mlir#280 from tetuante:PRissue270 d26d88d090d3765d3b9884bfabdd023143f27287
PiperOrigin-RevId: 282905396
Change-Id: I1c55a92690dd31c28f9123b08dd482b52745681c
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

2 participants