Skip to content

Cannot run the android example on Android 5.1.1 #74

Description

@victordion

The android example APK can be successfully compiled and installed (except that adb -g option is not recognized), however, at launch it shows "Failed" without showing any camera view.

Device is a Nexus 6 with Android 5.1.1.

This is what I have in WORKSPACE

# Uncomment and update the paths in these entries to build the Android demo.
android_sdk_repository(
    name = "androidsdk",
    api_level = 22, 
    build_tools_version = "22.0.1",
    # Replace with path to Android SDK on your system
    path = "/home/victor/Android/Sdk/",
)
#
android_ndk_repository(
    name="androidndk",
    path="/home/victor/Downloads/android-ndk-r10e",
    api_level=21)

logcat information

I/tensorflow( 7634): CameraConnectionFragment: Opening camera preview: 4160x3120
E/CameraDeviceClient( 1539): beginConfigure: Not implemented yet.
W/CameraDeviceClient( 1539): createStream: Camera 0: Forcing asynchronous mode for stream
W/CameraDeviceClient( 1539): createStream: Camera 0: Overriding format 0x1 to IMPLEMENTATION_DEFINED
E/QCamera3HWI( 1539): int qcamera::QCamera3HardwareInterface::configureStreams(camera3_stream_configuration_t*): Number of streams on ISP encoder path exceeds limits of 2
W/CameraDevice-JV-0( 7634): Stream configuration failed
E/CameraCaptureSession( 7634): Session 0: Failed to create capture session; configuration failed
I/tensorflow( 7634): CameraConnectionFragment: Getting assets.
I/native  ( 7634): tensorflow/examples/android/jni/tensorflow_jni.cc:41 Compute graph already loaded. skipping.
I/tensorflow( 7634): CameraConnectionFragment: Tensorflow initialized.

Activity

  1. changed the title [-]Cannot run the android example on 5.1.1[/-] [+]Cannot run the android example on Android 5.1.1[/+] on Nov 10, 2015
  2. nelsonsilva commented on Nov 10, 2015

    @nelsonsilva

    Had a similar issue but was related to the fact that the example is looking for a specific 480x320 camera preview size, see:
    https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/android/src/org/tensorflow/demo/CameraConnectionFragment.java#L231

    Just changed that line to: if (option.getHeight() > 320 && option.getWidth() > 480) and it worked.

  3. andrewharp commented on Nov 10, 2015

    @andrewharp
    Contributor

    Yes, the intention was to pick a size larger, but not too much larger (for performance reasons), than the 224x224 input of the Inception model bundled with the demo. There's a fix incoming that will pick a size dynamically.

  4. victordion commented on Nov 10, 2015

    @victordion
    Author

    Thank dudes, you made my day.

  5. added a commit that references this issue on Mar 9, 2016
  6. added a commit that references this issue on Oct 16, 2018
  7. added a commit that references this issue on Aug 20, 2019
    a3fb4cd
  8. added a commit that references this issue on Oct 4, 2019
    1b4a771
  9. added a commit that references this issue on Dec 6, 2019
  10. added a commit that references this issue on May 17, 2022
  11. added 2 commits that reference this issue on Mar 4, 2025
  12. added 4 commits that reference this issue on Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions