Loading the newer inception model in Android demo example and No OpKernel was registered to support Op error · Issue #1269 · tensorflow/tensorflow · GitHub
Skip to content

Loading the newer inception model in Android demo example and No OpKernel was registered to support Op error #1269

Description

@syed-ahmed

Steps to reproduce

  1. Load the model in the asset folder from here: http://download.tensorflow.org/models/image/imagenet/inception-2015-12-05.tgz
    rather than here: https://storage.googleapis.com/download.tensorflow.org/models/inception5h.zip
    This step loads the model which is used in image_retrain, label_image and classify examples. The link for the model in the android demo is old and has some differences that don't work with the other demos as mentioned in Update the Android demo to use retrained models #1253
  2. Change the input_width and input_mean in TensorflowImageListener.java
  3. Change the input tensor name and output tensor name as follows in the tensorflow_jni.cc

What have you tried?

  1. I changed the input_width from 224 to 299 and input_mean from 117 to 128.
  2. When the input tensor name was input:0 and output tensor name was output:0 I got the following node not found error

02-23 23:56:11.066 15084-15105/org.tensorflow.demo I/native: tensorflow/examples/android/jni/tensorflow_jni.cc:271 Width: 299 02-23 23:56:11.066 15084-15105/org.tensorflow.demo I/native: tensorflow/examples/android/jni/tensorflow_jni.cc:272 Stride: 1196 02-23 23:56:11.066 15084-15105/org.tensorflow.demo I/native: tensorflow/examples/android/jni/tensorflow_jni.cc:176 Tensorflow: Copying Data. 02-23 23:56:11.070 15084-15105/org.tensorflow.demo I/native: tensorflow/examples/android/jni/tensorflow_jni.cc:194 Start computing. 02-23 23:56:11.157 15084-15105/org.tensorflow.demo I/native: tensorflow/examples/android/jni/tensorflow_jni.cc:205 End computing. Ran in 86ms (91ms avg over 7 runs) 02-23 23:56:11.157 15084-15105/org.tensorflow.demo E/native: tensorflow/examples/android/jni/tensorflow_jni.cc:210 Error during inference: Not found: FetchOutputs node output:0: not found

  1. When the input tensor name was Mul:0 and output tensor name was softmax:0 I got the following error

02-24 00:07:46.149 23093-23123/org.tensorflow.demo I/native: tensorflow/examples/android/jni/tensorflow_jni.cc:270 Height: 299 02-24 00:07:46.149 23093-23123/org.tensorflow.demo I/native: tensorflow/examples/android/jni/tensorflow_jni.cc:271 Width: 299 02-24 00:07:46.149 23093-23123/org.tensorflow.demo I/native: tensorflow/examples/android/jni/tensorflow_jni.cc:272 Stride: 1196 02-24 00:07:46.149 23093-23123/org.tensorflow.demo I/native: tensorflow/examples/android/jni/tensorflow_jni.cc:176 Tensorflow: Copying Data. 02-24 00:07:46.152 23093-23123/org.tensorflow.demo I/native: tensorflow/examples/android/jni/tensorflow_jni.cc:194 Start computing. 02-24 00:07:46.222 23093-23123/org.tensorflow.demo I/native: tensorflow/examples/android/jni/tensorflow_jni.cc:205 End computing. Ran in 70ms (77ms avg over 35 runs) 02-24 00:07:46.222 23093-23123/org.tensorflow.demo E/native: tensorflow/examples/android/jni/tensorflow_jni.cc:210 Error during inference: Invalid argument: No OpKernel was registered to support Op 'BatchNormWithGlobalNormalization' with these attrs [[Node: conv/batchnorm = BatchNormWithGlobalNormalization[T=DT_FLOAT, scale_after_normalization=false, variance_epsilon=0.001](conv/Conv2D, conv/batchnorm/moving_mean, conv/batchnorm/moving_variance, conv/batchnorm/beta, conv/batchnorm/gamma)]]

That's good news that the android demo code is finding the nodes in the new model after the changes. However, I have no idea what this error means. I would really appreciate if someone can explain. (Although this issue is being taken care of in #1253, I am still doing it myself in an attempt to learn more about tensorflow)
No OpKernel was registered to support Op 'BatchNormWithGlobalNormalization' with these attrs [[Node: conv/batchnorm = BatchNormWithGlobalNormalization[T=DT_FLOAT, scale_after_normalization=false, variance_epsilon=0.001](conv/Conv2D, conv/batchnorm/moving_mean, conv/batchnorm/moving_variance, conv/batchnorm/beta, conv/batchnorm/gamma)]]

Looking at the main.cc in the label_image example, I see something about "normalized" in the ReadTensorFromImage function. Don't know if that's helpful information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions