Skip to content

Android "TF Stylize" demo crash with "input_max_range must be larger than input_min_range" #8550

Closed

Description

@BrianOn99

I have compiled and installed the demo app according to the instruction in the README. The "TF Detect" and "TF Classify" apps are working as expected. However, starting the "TF Stylize" app, it always crashes in about 3 seconds. The prebuilt apk crashes in the same way. Here is the android logcat recorded:

$ adb -s b80360c7 logcat | grep Tensor
I/TensorFlowInferenceInterface( 6801): Checking to see if TensorFlow native methods are already loaded
I/TensorFlowInferenceInterface( 6801): TensorFlow native methods not found, attempting to load via tensorflow_inference
I/TensorFlowInferenceInterface( 6801): Successfully loaded TensorFlow native methods (RunStats error may be ignored)
I/TensorFlowInferenceInterface( 6801): Model load took 540ms, TensorFlow version: 1.0.1
I/TensorFlowInferenceInterface( 6801): Successfully loaded model from 'file:///android_asset/stylize_quantized.pb'
E/TensorFlowInferenceInterface( 6801): Failed to run TensorFlow inference with inputs:[input, style_num], outputs:[transformer/expand/conv3/conv/Sigmoid]
E/TensorFlowInferenceInterface( 6801): Inference exception: java.lang.IllegalArgumentException: input_max_range must be larger than input_min_range.
E/TensorFlowInferenceInterface( 6801): [[Node: transformer/contract/conv1/Relu_eightbit_quantize_transformer/contract/conv1/InstanceNorm/batchnorm/add_1 = QuantizeV2[T=DT_QUINT8, mode="MIN_FIRST", _device="/job:localhost/replica:0/task:0/cpu:0"](transformer/contract/conv1/InstanceNorm/batchnorm/add_1, transformer/contract/conv1/Relu_eightbit_min_transformer/contract/conv1/InstanceNorm/batchnorm/add_1, transformer/contract/conv1/Relu_eightbit_max_transformer/contract/conv1/InstanceNorm/batchnorm/add_1)]]
E/AndroidRuntime( 6801): at org.tensorflow.contrib.android.TensorFlowInferenceInterface.getTensor(TensorFlowInferenceInterface.java:486)
E/AndroidRuntime( 6801): at org.tensorflow.contrib.android.TensorFlowInferenceInterface.readNodeIntoFloatBuffer(TensorFlowInferenceInterface.java:332)
E/AndroidRuntime( 6801): at org.tensorflow.contrib.android.TensorFlowInferenceInterface.readNodeFloat(TensorFlowInferenceInterface.java:287)

As can be inferred from the logcat, the problem happens in tensorflow/core/kernels/quantize_op.cc line 71. The app is using a quantized model. I found that input_min_range is set to be inf, and input_max_range is -inf, which is obviously wrong.

What should be done to fix it?

The crash appears on Samsung Galaxy S4, but does not appears on emulator with Intel CPU.

[Edit]
With more experiment I found that sometimes the apps works without crashing, about 1 out of 10 trials.

Activity

  1. BrianOn99 commented on Mar 21, 2017

    @BrianOn99
    Author

    It is found that if DEBUG_MODEL is set to true in StylizeActivity.java, which replace the camera captured bitmap with a predefined one, the app will not crash.

  2. self-assigned this
    on Mar 21, 2017
  3. andrewharp commented on Mar 21, 2017

    @andrewharp
    Contributor

    Do the other demos work for you? If so, I'm guessing the preview frame size it's choosing is broken somehow (stylization uses a larger one than the other demos).

    Can you paste a full log please?

  4. BrianOn99 commented on Mar 22, 2017

    @BrianOn99
    Author

    @andrewharp thanks for looking into this issue. Actually the other demo has some non-fatal problems (I thought they were unrelated).

    TF classify

    • Sometimes a Toast "Failed" is shown, then there is no camera preview.
    • In case problem 1 does not happen, the camera preview is widened.

    TF Detect

    • Same issues as TF classify
    • I have not yet success in using it to detect any people

    I can reproduce all of these problems, except "Failed" Toast, in another phone (LG G4c, also android 5). So could it be android 5 specific problem. I have no more phones on my hand for testing so could somebody here try it out?

    Here is the full log from the LG phone captured from AndroidStudiio:

    03-22 11:01:10.090 9698-9698/? I/art: Late-enabling -Xcheck:jni
    03-22 11:01:10.230 9698-9698/org.tensorflow.demo D/ContextHelper: convertTheme. context->name=org.tensorflow.demo themeResourceId=2131165185
    03-22 11:01:10.230 9698-9698/org.tensorflow.demo D/tensorflow: CameraActivity: onCreate org.tensorflow.demo.StylizeActivity@35597053
    03-22 11:01:10.240 9698-9698/org.tensorflow.demo I/PhoneWindow: [generateLayout] setColorNavigationBar => color=0x ff000001
    03-22 11:01:10.240 9698-9698/org.tensorflow.demo D/PhoneWindowEx: [PWEx][generateLayout] setNavigationBarColor2 : colors=0xff000000
    03-22 11:01:10.240 9698-9698/org.tensorflow.demo I/PhoneWindow: [setNavigationBarColor2] color=0x ff000000
    03-22 11:01:10.260 9698-9698/org.tensorflow.demo D/tensorflow: CameraActivity: onStart org.tensorflow.demo.StylizeActivity@35597053
    03-22 11:01:10.260 9698-9698/org.tensorflow.demo D/tensorflow: CameraActivity: onResume org.tensorflow.demo.StylizeActivity@35597053
    03-22 11:01:10.260 9698-9698/org.tensorflow.demo I/Activity: Activity.onPostResume() called 
    03-22 11:01:10.270 9698-9718/org.tensorflow.demo D/OpenGLRenderer: Render dirty regions requested: true
    03-22 11:01:10.270 9698-9718/org.tensorflow.demo I/Adreno-EGL: <qeglDrvAPI_eglInitialize:379>: EGL 1.4 QUALCOMM build:  (I68fa98814b)
                                                                   OpenGL ES Shader Compiler Version: E031.25.03.01
                                                                   Build Date: 07/17/15 Fri
                                                                   Local Branch: LA.BR.1.1.2_RB1-AU010-1169358
                                                                   Remote Branch: 
                                                                   Local Patches: 
                                                                   Reconstruct Branch: 
    03-22 11:01:10.270 9698-9718/org.tensorflow.demo I/OpenGLRenderer: Initialized EGL, version 1.4
    03-22 11:01:10.290 9698-9718/org.tensorflow.demo D/OpenGLRenderer: Enabling debug mode 0
    03-22 11:01:10.310 9698-9698/org.tensorflow.demo D/Atlas: Validating map...
    03-22 11:01:10.390 9698-9698/org.tensorflow.demo W/ArrayUtils: Ignoring invalid value mw_continuous-picture
    03-22 11:01:10.390 9698-9698/org.tensorflow.demo W/ArrayUtils: Ignoring invalid value manual
    03-22 11:01:10.390 9698-9698/org.tensorflow.demo W/ArrayUtils: Ignoring invalid value emboss
    03-22 11:01:10.390 9698-9698/org.tensorflow.demo W/ArrayUtils: Ignoring invalid value sketch
    03-22 11:01:10.390 9698-9698/org.tensorflow.demo W/ArrayUtils: Ignoring invalid value neon
    03-22 11:01:10.390 9698-9698/org.tensorflow.demo W/ArrayUtils: Ignoring invalid value asd
    03-22 11:01:10.390 9698-9698/org.tensorflow.demo W/ArrayUtils: Ignoring invalid value backlight
    03-22 11:01:10.390 9698-9698/org.tensorflow.demo W/ArrayUtils: Ignoring invalid value flowers
    03-22 11:01:10.390 9698-9698/org.tensorflow.demo W/ArrayUtils: Ignoring invalid value AR
    03-22 11:01:10.400 9698-9698/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Adding size: 1920x1440
    03-22 11:01:10.400 9698-9698/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Adding size: 1920x1200
    03-22 11:01:10.400 9698-9698/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Adding size: 1920x1080
    03-22 11:01:10.400 9698-9698/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Adding size: 1600x1200
    03-22 11:01:10.400 9698-9698/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Adding size: 1468x1200
    03-22 11:01:10.400 9698-9698/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Not adding size: 1280x960
    03-22 11:01:10.400 9698-9698/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Not adding size: 1280x800
    03-22 11:01:10.400 9698-9698/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Not adding size: 1280x720
    03-22 11:01:10.400 9698-9698/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Not adding size: 960x720
    03-22 11:01:10.400 9698-9698/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Not adding size: 864x480
    03-22 11:01:10.400 9698-9698/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Not adding size: 854x480
    03-22 11:01:10.400 9698-9698/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Not adding size: 848x480
    03-22 11:01:10.400 9698-9698/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Not adding size: 800x480
    03-22 11:01:10.400 9698-9698/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Not adding size: 720x480
    03-22 11:01:10.400 9698-9698/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Not adding size: 768x432
    03-22 11:01:10.400 9698-9698/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Not adding size: 640x480
    03-22 11:01:10.400 9698-9698/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Not adding size: 576x432
    03-22 11:01:10.400 9698-9698/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Not adding size: 480x320
    03-22 11:01:10.400 9698-9698/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Not adding size: 384x288
    03-22 11:01:10.400 9698-9698/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Not adding size: 352x288
    03-22 11:01:10.400 9698-9698/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Not adding size: 320x240
    03-22 11:01:10.400 9698-9698/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Not adding size: 240x160
    03-22 11:01:10.400 9698-9698/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Not adding size: 176x144
    03-22 11:01:10.400 9698-9698/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Not adding size: 144x176
    03-22 11:01:10.400 9698-9698/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Not adding size: 160x120
    03-22 11:01:10.400 9698-9698/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Chosen size: 1468x1200
    03-22 11:01:10.400 9698-9698/org.tensorflow.demo E/art: No implementation found for long org.tensorflow.contrib.android.RunStats.allocate() (tried Java_org_tensorflow_contrib_android_RunStats_allocate and Java_org_tensorflow_contrib_android_RunStats_allocate__)
    03-22 11:01:10.400 9698-9698/org.tensorflow.demo I/TensorFlowInferenceInterface: Loading tensorflow_inference.
    03-22 11:01:11.000 9698-9698/org.tensorflow.demo I/TensorFlowInferenceInterface: Model load took -496ms, TensorFlow version: 1.0.0
    03-22 11:01:11.000 9698-9698/org.tensorflow.demo I/tensorflow: StylizeActivity: Sensor orientation: 90, Screen orientation: 0
    03-22 11:01:11.110 9698-9713/org.tensorflow.demo I/art: CheckpointMarkThreadRoots callback created = 0xb7e9a3d8
    03-22 11:01:11.120 9698-9713/org.tensorflow.demo I/art: CheckpointMarkThreadRoots callback created = 0xb7c21750
    03-22 11:01:11.130 9698-9713/org.tensorflow.demo I/art: CheckpointMarkThreadRoots callback created = 0xb8187ab0
    03-22 11:01:11.140 9698-9713/org.tensorflow.demo I/art: CheckpointMarkThreadRoots callback created = 0xb7ed5610
    03-22 11:01:11.420 9698-9698/org.tensorflow.demo W/ArrayUtils: Ignoring invalid value mw_continuous-picture
    03-22 11:01:11.420 9698-9698/org.tensorflow.demo W/ArrayUtils: Ignoring invalid value manual
    03-22 11:01:11.420 9698-9698/org.tensorflow.demo W/ArrayUtils: Ignoring invalid value emboss
    03-22 11:01:11.420 9698-9698/org.tensorflow.demo W/ArrayUtils: Ignoring invalid value sketch
    03-22 11:01:11.420 9698-9698/org.tensorflow.demo W/ArrayUtils: Ignoring invalid value neon
    03-22 11:01:11.420 9698-9698/org.tensorflow.demo W/ArrayUtils: Ignoring invalid value asd
    03-22 11:01:11.420 9698-9698/org.tensorflow.demo W/ArrayUtils: Ignoring invalid value backlight
    03-22 11:01:11.420 9698-9698/org.tensorflow.demo W/ArrayUtils: Ignoring invalid value flowers
    03-22 11:01:11.420 9698-9698/org.tensorflow.demo W/ArrayUtils: Ignoring invalid value AR
    03-22 11:01:11.420 9698-9698/org.tensorflow.demo I/CameraManager: Using legacy camera HAL.
    03-22 11:01:11.560 9698-9708/org.tensorflow.demo W/art: Suspending all threads took: 19.075ms
    03-22 11:01:11.610 9698-9698/org.tensorflow.demo W/ArrayUtils: Ignoring invalid value mw_continuous-picture
    03-22 11:01:11.610 9698-9698/org.tensorflow.demo W/ArrayUtils: Ignoring invalid value manual
    03-22 11:01:11.610 9698-9698/org.tensorflow.demo W/ArrayUtils: Ignoring invalid value emboss
    03-22 11:01:11.610 9698-9698/org.tensorflow.demo W/ArrayUtils: Ignoring invalid value sketch
    03-22 11:01:11.610 9698-9698/org.tensorflow.demo W/ArrayUtils: Ignoring invalid value neon
    03-22 11:01:11.610 9698-9698/org.tensorflow.demo W/ArrayUtils: Ignoring invalid value asd
    03-22 11:01:11.610 9698-9698/org.tensorflow.demo W/ArrayUtils: Ignoring invalid value backlight
    03-22 11:01:11.610 9698-9698/org.tensorflow.demo W/ArrayUtils: Ignoring invalid value flowers
    03-22 11:01:11.610 9698-9698/org.tensorflow.demo W/ArrayUtils: Ignoring invalid value AR
    03-22 11:01:11.630 9698-9717/org.tensorflow.demo I/tensorflow: CameraConnectionFragment: Opening camera preview: 1468x1200
    03-22 11:01:11.640 9698-9698/org.tensorflow.demo I/Choreographer: Skipped 73 frames!  The application may be doing too much work on its main thread.
    03-22 11:01:11.650 9698-9717/org.tensorflow.demo I/CameraDeviceState: Legacy camera service transitioning to state CONFIGURING
    03-22 11:01:11.650 9698-9777/org.tensorflow.demo I/RequestThread-0: Configure outputs: 2 surfaces configured.
    03-22 11:01:11.650 9698-9777/org.tensorflow.demo D/Camera: app passed NULL surface
    03-22 11:01:11.710 9698-9717/org.tensorflow.demo I/CameraDeviceState: Legacy camera service transitioning to state IDLE
    03-22 11:01:11.710 9698-9698/org.tensorflow.demo I/art: Thread[1,tid=9698,WaitingForJniOnLoad,Thread*=0xb752c300,peer=0x766c3328,"main"] recursive attempt to load library "/system/lib/libhook_jni.so"
    03-22 11:01:11.720 9698-9717/org.tensorflow.demo I/RequestQueue: Repeating capture request set.
    03-22 11:01:11.720 9698-9777/org.tensorflow.demo W/LegacyRequestMapper: convertRequestMetadata - control.awbRegions setting is not supported, ignoring value
    03-22 11:01:11.720 9698-9777/org.tensorflow.demo W/LegacyRequestMapper: Only received metering rectangles with weight 0.
    03-22 11:01:11.720 9698-9777/org.tensorflow.demo W/LegacyRequestMapper: Only received metering rectangles with weight 0.
    03-22 11:01:11.720 9698-9698/org.tensorflow.demo E/MediaProfilesEx-JNI: register_com_lge_media_MediaProfilesEx
    03-22 11:01:11.730 9698-9698/org.tensorflow.demo E/MediaRecorderEx-JNI: register_com_lge_media_MediaRecorderEx
    03-22 11:01:11.730 9698-9698/org.tensorflow.demo D/AudioSystemEx: register_com_lge_media_LGAudioSystem
    03-22 11:01:11.730 9698-9698/org.tensorflow.demo E/SurfaceControlEx: register_com_lge_view_SurfaceControlEx
    03-22 11:01:11.730 9698-9698/org.tensorflow.demo I/art: Thread[1,tid=9698,WaitingForJniOnLoad,Thread*=0xb752c300,peer=0x766c3328,"main"] recursive attempt to load library "/system/lib/libhook_jni.so"
    03-22 11:01:11.730 9698-9698/org.tensorflow.demo D/LGMtpDatabaseJNI: register_android_mtp_LGMtpDatabase
    03-22 11:01:11.730 9698-9698/org.tensorflow.demo I/art: Thread[1,tid=9698,WaitingForJniOnLoad,Thread*=0xb752c300,peer=0x766c3328,"main"] recursive attempt to load library "/system/lib/libhook_jni.so"
    03-22 11:01:11.730 9698-9698/org.tensorflow.demo D/LGMtpServerJNI: register_android_mtp_LGMtpServer
    03-22 11:01:11.730 9698-9698/org.tensorflow.demo I/art: Thread[1,tid=9698,WaitingForJniOnLoad,Thread*=0xb752c300,peer=0x766c3328,"main"] recursive attempt to load library "/system/lib/libhook_jni.so"
    03-22 11:01:11.730 9698-9698/org.tensorflow.demo E/MediaPlayerEx-jni: register_com_lge_view_MediaPlayerEx
    03-22 11:01:11.730 9698-9698/org.tensorflow.demo I/art: Thread[1,tid=9698,WaitingForJniOnLoad,Thread*=0xb752c300,peer=0x766c3328,"main"] recursive attempt to load library "/system/lib/libhook_jni.so"
                                                            
                                                            [ 03-22 11:01:11.730  9698: 9698 D/         ]
                                                            register_com_lge_emoji_EmojiUtil
    03-22 11:01:11.900 9698-9698/org.tensorflow.demo I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@b0a0dc1 time:128717133
    03-22 11:01:11.970 9698-9778/org.tensorflow.demo I/CameraDeviceState: Legacy camera service transitioning to state CAPTURING
    03-22 11:01:12.200 9698-9717/org.tensorflow.demo D/ImageReader_JNI: ImageReader_imageSetup: Overriding buffer format YUV_420_888 to 32315659.
    03-22 11:01:12.200 9698-9717/org.tensorflow.demo I/tensorflow: StylizeActivity: Initializing at size preview size 1468x1200, stylize size 256
    03-22 11:01:12.200 9698-9717/org.tensorflow.demo D/tensorflow: CameraActivity: Initializing buffer 0 at size 1766400
    03-22 11:01:12.210 9698-9717/org.tensorflow.demo D/tensorflow: CameraActivity: Initializing buffer 1 at size 441600
    03-22 11:01:12.220 9698-9717/org.tensorflow.demo D/tensorflow: CameraActivity: Initializing buffer 2 at size 441600
    03-22 11:01:13.420 9698-9716/org.tensorflow.demo E/TensorFlowInferenceInterface: Failed to run TensorFlow session: java.lang.IllegalArgumentException: input_max_range must be larger than input_min_range.
                                                                                     	 [[Node: transformer/contract/conv1/Relu_eightbit_quantize_transformer/contract/conv1/InstanceNorm/batchnorm/add_1 = QuantizeV2[T=DT_QUINT8, mode="MIN_FIRST", _device="/job:localhost/replica:0/task:0/cpu:0"](transformer/contract/conv1/InstanceNorm/batchnorm/add_1, transformer/contract/conv1/Relu_eightbit_min_transformer/contract/conv1/InstanceNorm/batchnorm/add_1, transformer/contract/conv1/Relu_eightbit_max_transformer/contract/conv1/InstanceNorm/batchnorm/add_1)]]
    03-22 11:01:13.460 9698-9716/org.tensorflow.demo E/AndroidRuntime: FATAL EXCEPTION: inference
                                                                       Process: org.tensorflow.demo, PID: 9698
                                                                       java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
                                                                           at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)
                                                                           at java.util.ArrayList.get(ArrayList.java:308)
                                                                           at org.tensorflow.contrib.android.TensorFlowInferenceInterface.getTensor(TensorFlowInferenceInterface.java:473)
                                                                           at org.tensorflow.contrib.android.TensorFlowInferenceInterface.readNodeIntoFloatBuffer(TensorFlowInferenceInterface.java:320)
                                                                           at org.tensorflow.contrib.android.TensorFlowInferenceInterface.readNodeFloat(TensorFlowInferenceInterface.java:275)
                                                                           at org.tensorflow.demo.StylizeActivity.stylizeImage(StylizeActivity.java:591)
                                                                           at org.tensorflow.demo.StylizeActivity.access$1400(StylizeActivity.java:66)
                                                                           at org.tensorflow.demo.StylizeActivity$3.run(StylizeActivity.java:543)
                                                                           at android.os.Handler.handleCallback(Handler.java:739)
                                                                           at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                           at android.os.Looper.loop(Looper.java:135)
                                                                           at android.os.HandlerThread.run(HandlerThread.java:61)
    03-22 11:01:13.480 9698-9698/org.tensorflow.demo I/RequestQueue: Repeating capture request cancelled.
    03-22 11:01:13.640 9698-9715/org.tensorflow.demo E/BufferQueueProducer: [unnamed-9698-2] cancelBuffer: BufferQueue has been abandoned
    03-22 11:01:13.640 9698-9714/org.tensorflow.demo E/BufferQueueProducer: [unnamed-9698-2] cancelBuffer: BufferQueue has been abandoned
    03-22 11:01:13.640 9698-9715/org.tensorflow.demo E/BufferQueueProducer: [unnamed-9698-2] cancelBuffer: BufferQueue has been abandoned
    03-22 11:01:13.640 9698-9714/org.tensorflow.demo E/BufferQueueProducer: [unnamed-9698-2] cancelBuffer: BufferQueue has been abandoned
    03-22 11:01:13.640 9698-9715/org.tensorflow.demo E/BufferQueueProducer: [unnamed-9698-2] cancelBuffer: BufferQueue has been abandoned
    03-22 11:01:13.710 9698-9698/org.tensorflow.demo D/tensorflow: CameraActivity: onPause org.tensorflow.demo.StylizeActivity@35597053
    03-22 11:01:19.370 9698-9710/org.tensorflow.demo W/MessageQueue: Handler (android.os.Handler) {eaa714e} sending message to a Handler on a dead thread
                                                                     java.lang.IllegalStateException: Handler (android.os.Handler) {eaa714e} sending message to a Handler on a dead thread
                                                                         at android.os.MessageQueue.enqueueMessage(MessageQueue.java:325)
                                                                         at android.os.Handler.enqueueMessage(Handler.java:631)
                                                                         at android.os.Handler.sendMessageAtFrontOfQueue(Handler.java:623)
                                                                         at android.hardware.camera2.legacy.RequestThreadManager.quit(RequestThreadManager.java:941)
                                                                         at android.hardware.camera2.legacy.LegacyCameraDevice.close(LegacyCameraDevice.java:444)
                                                                         at android.hardware.camera2.legacy.LegacyCameraDevice.finalize(LegacyCameraDevice.java:468)
                                                                         at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:190)
                                                                         at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:173)
                                                                         at java.lang.Thread.run(Thread.java:818)
    
  5. BrianOn99 commented on Mar 22, 2017

    @BrianOn99
    Author

    I would like to emphasize that this issue does not always happen. Sometimes stylization works for several frames and then crash due to this issue.

  6. andrewharp commented on Mar 22, 2017

    @andrewharp
    Contributor

    It's probably giving back an unexpected buffer format:
    03-22 11:01:12.200 9698-9717/org.tensorflow.demo D/ImageReader_JNI: ImageReader_imageSetup: Overriding buffer format YUV_420_888 to 32315659. 32315659 maps to NV12.

    What is the android.info.supportedHardwareLevel on your device? Some devices don't fully support the camera2 api, unfortunately, and emulate it problematically internally.

    If you press the volume keys you'll turn on debug mode, which will render the image being processed. Might be helpful to see what that looks like in each of the demos.

  7. BrianOn99 commented on Mar 22, 2017

    @BrianOn99
    Author

    It is "2", which correspond to INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY. So does it mean the issue cannot be solved?

  8. BrianOn99 commented on Mar 22, 2017

    @BrianOn99
    Author

    If it cannot be solved I think it would be better to show a warning on the demo app for those phones.

  9. BrianOn99 commented on Mar 22, 2017

    @BrianOn99
    Author

    If it is suitable I can contribute code or just make a test.

  10. andrewharp commented on Mar 22, 2017

    @andrewharp
    Contributor

    The best thing to do would probably be to interact with the camera via the original android.hardware.Camera if the supportedHardwareLevel or Android API level is too low.

    If you or someone else would like to contribute that it would be very much appreciated. This might also resolve #7464.

  11. andrewharp commented on Mar 22, 2017

    @andrewharp
    Contributor

    An easier workaround would be if INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY is detected, just use the Y (luminance) plane. It can be mapped directly into RGB grayscale values. Detection quality might suffer a small amount (so a toast/log message would be warranted), but at least it wouldn't crash.

  12. andrewharp commented on Mar 23, 2017

    @andrewharp
    Contributor

    @BrianOn99 What is your device's API level? I'm wondering if maybe it might just be a good idea to use android.hardware.Camera on devices < API 23. There is an example of doing that here.

  13. andrewharp commented on Mar 24, 2017

    @andrewharp
    Contributor

    @BrianOn99 Another idea from the other issue: can you try hardcoding the size to 1920x1080? It's a few more pixels to convert YUV->RGB than 1468x1200, but it may behave better because it's a more popular video size and so would have had more testing by Samsung.

  14. BrianOn99 commented on Mar 24, 2017

    @BrianOn99
    Author

    Thanks. I will try it later today.

  15. BrianOn99 commented on Mar 24, 2017

    @BrianOn99
    Author

    Do you mean changing the previewSize in CameraConnectionFragment?

  16. 21 remaining items

  17. tensorflowbutler commented on Feb 8, 2018

    @tensorflowbutler
    Member

    Nagging Assignee: It has been 14 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

  18. tensorflowbutler commented on Feb 23, 2018

    @tensorflowbutler
    Member

    Nagging Assignee: It has been 14 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

  19. tensorflowbutler commented on Mar 10, 2018

    @tensorflowbutler
    Member

    Nagging Assignee @andrewharp: It has been 14 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

  20. tensorflowbutler commented on Mar 25, 2018

    @tensorflowbutler
    Member

    Nagging Assignee @andrewharp: It has been 14 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

  21. tensorflowbutler commented on Apr 9, 2018

    @tensorflowbutler
    Member

    Nagging Assignee @andrewharp: It has been 14 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

  22. tensorflowbutler commented on Apr 24, 2018

    @tensorflowbutler
    Member

    Nagging Assignee @andrewharp: It has been 14 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

  23. tensorflowbutler commented on May 10, 2018

    @tensorflowbutler
    Member

    Nagging Assignee @andrewharp: It has been 15 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

  24. GL1920 commented on May 22, 2018

    @GL1920

    @BrianOn99
    I have the same problem as you.But when I replace the camera captured bitmap with a predefined one,I couldn't get a stylized picture , just a grey one.I wanted to ask you how you handled the designated bitmap.

  25. tensorflowbutler commented on Jun 5, 2018

    @tensorflowbutler
    Member

    Nagging Assignee @andrewharp: It has been 14 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

  26. tensorflowbutler commented on Jun 20, 2018

    @tensorflowbutler
    Member

    Nagging Assignee @andrewharp: It has been 29 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

  27. tensorflowbutler commented on Jul 5, 2018

    @tensorflowbutler
    Member

    Nagging Assignee @andrewharp: It has been 44 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

  28. tensorflowbutler commented on Jul 20, 2018

    @tensorflowbutler
    Member

    Nagging Assignee @andrewharp: It has been 59 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

  29. tensorflowbutler commented on Aug 4, 2018

    @tensorflowbutler
    Member

    Nagging Assignee @andrewharp: It has been 74 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

  30. BrianOn99 commented on Aug 6, 2018

    @BrianOn99
    Author

    Closed because I don't care about it anymore and this issue has been inactive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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