tensorflow: Unsupported Operation (MEAN) while trying to apply GpuDelegate to tflite
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: Nop, just some assembled statements
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): MacOS 10.14
- Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: Samsung S9
- TensorFlow installed from (source or binary): binary
- TensorFlow version (use command below): tf-nightly 1.15.0.dev20190812
- Python version: 3.6.5
Describe the current behavior I’m trying to convert the Keras’s MobileNet model with float16 precision for Gpu Inference. But when running tasks, I encountered the following Error:
Caused by: java.lang.IllegalArgumentException: Internal error: Failed to apply delegate: Next operations are not supported by GPU delegate: MEAN: Operation is not supported. First 88 operations will run on the GPU, and the remaining 5 on the CPU.tensorflow/lite/kernels/conv.cc:259 bias->type != input_type (10 != 1)Node number 90 (CONV_2D) failed to prepare. tensorflow/lite/kernels/conv.cc:259 bias->type != input_type (10 != 1)Node number 3 (CONV_2D) failed to prepare.
Describe the expected behavior
Code to reproduce the issue the Python script for conversion is here:
import tensorflow as tf
import tensorflow.keras as keras
model = keras.applications.mobilenet.MobileNet(input_shape=None, alpha=1.0, depth_multiplier=1, dropout=1e-3, include_top=True, weights='imagenet', input_tensor=None, pooling=None, classes=1000)
converter = tf.lite.TFLiteConverter.from_keras_model_file("mobilenet.h5")
converter.optimizations = [tf.lite.Optimize.DEFAULT]
converter.target_spec.supported_types = [tf.lite.constants.FLOAT16]
tflite_model = converter.convert()
open("mobilenet.tflite", "wb").write(tflite_model)
and in Android code, I called tfliteOptions.setAllowFp16PrecisionForFp32(true);
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.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 18 (7 by maintainers)
@David-Xiang
Yeah, unfortunately, MEAN is not implemented. We have gotten enough requests re: MEAN, so that we decided to implement it, but we don’t have an ETA yet 😦 As your graph has 93 operations, and the first 88 is running on GPU, and only the last 5 on the CPU, it should be ok.
The real failure why your graph is not working is because of:
and that’s a failure on the TFLite CPU, and not GPU. @gadagashwini can you re-assign?