Issue 1:
Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

Have I written custom code (as opposed to using a stock example script provided in TensorFlow): YES

OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 16.04

Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: Internal Android 8.1 board

TensorFlow installed from (source or binary): source

TensorFlow version (use command below): 1.13.1

Python version: 2.7

Bazel version (if compiling from source): 0.22.0

GCC/Compiler version (if compiling from source):

CUDA/cuDNN version:

GPU model and memory: Mali-T864 GPU

You can collect some of this information using our environment capture

script

You can also obtain the TensorFlow version with: 1. TF 1.0: python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)" 2. TF 2.0: python -c "import tensorflow as tf; print(tf.version.GIT_VERSION, tf.version.VERSION)"

Describe the current behavior

I wrote a simple demo using tflite opengles delegate to run deeplab models from model zoo.

I have tried your hosted model deeplabv3_mv2_257_gpu.tflite, It works perfect on my device on CPU and Opengles delegate.

However, when I tried the deeplab mode with xception65 , The tflite perform differently on CPU and Opengles delegate. My input layer is sub_7, output layer is ResizeBilinear_3.

Here is my result:

test image:

result from CPU (correct):

result from opengles delegate:

I believed that this issue is related to the operations(BATCH_TO_SPACE_ND, SPACE_TO_BATCH_ND) that opengles not supporting thus fallback to CPU. Another issue of mine described more detail.

Flatten the unsupported ops using graph_transforms also failed. It gives me the same inaccurate result or shows message like:

INFO: Initialized TensorFlow Lite runtime. INFO: Created TensorFlow Lite delegate for GPU. ERROR: TfLiteGpuDelegate Prepare: Program is not properly linked: L0005 The number of compute uniform components (1261) is greater than the maximum number allowed (1024). ERROR: Node number 199 (TfLiteGpuDelegate) failed to prepare. ERROR: Node number 199 (TfLiteGpuDelegate) failed to prepare.

Describe the expected behavior

all models work as good as your hosted model

Code to reproduce the issue

Provide a reproducible test case that is the bare minimum necessary to generate the problem.

Other info / logs

Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.

Issue 2:
Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template

System information

Have I written custom code (as opposed to using a stock example script provided in TensorFlow):NO

OS Platform and Distribution (e.g., Linux Ubuntu 16.04):Linux Ubuntu 16.04

Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:NA

TensorFlow installed from (source or binary):source

TensorFlow version (use command below):1.13.1

Python version: 2.7

Bazel version (if compiling from source): 0.22.0

GCC/Compiler version (if compiling from source):

CUDA/cuDNN version:

GPU model and memory:

You can collect some of this information using our environment capture

script

You can also obtain the TensorFlow version with: 1. TF 1.0: python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)" 2. TF 2.0: python -c "import tensorflow as tf; print(tf.version.GIT_VERSION, tf.version.VERSION)"

Describe the current behavior

I'm trying to train my own deeplab model using this code and convert it to tflite.

My target is to get a model similar to this

However, the model is obtained contains operations like:

SpaceToBatchND and BatchToSpaceND operations are not supported by tflite + opengles backend, they reduced the model's performance on my device.

In your hosted deeplab model, those three ops are replaced by DEPTHWISE_CONV_2D v2, which has options to set dilation factor. This would be the best solution for me but I'm not sure how to convert SpaceToBatchND-Conv2D-BatchToSpaceND into a singe DEPTHWISE_CONV_2D v2(dilation=2).

FYI, I have tried the graph_transforms tool under tensorflow/tools/graph_transforms to flatten the atrous conv. It upsampled the kernels instead of Space_To_Batch + Batch_To_Space. But this transform leads to much more computations that I cannot afford.

Describe the expected behavior

convert SpaceToBatchND-Conv2D-BatchToSpaceND into a singe DEPTHWISE_CONV_2D v2(dilation=2)

Code to reproduce the issue

Provide a reproducible test case that is the bare minimum necessary to generate the problem.

You can try any model under deeplab model zoo for example http://download.tensorflow.org/models/deeplabv3_mnv2_ade20k_train_2018_12_03.tar.gz

Other info / logs

Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.