automl icon indicating copy to clipboard operation
automl copied to clipboard

[Efficientdet-lite] ERROR: TfLiteGpuDelegate Init: STRIDED_SLICE: Output height doesn't match

Open alexdwu13 opened this issue 4 years ago • 0 comments

Issue

After exporting the pre-trained efficientdet-lite1 checkpoint to Tflite using model_inspect.py, and then benchmarking the model on the Android GPU Delegate, I'm met with this error:

/data/local/tmp # ./android_aarch64_benchmark_model --use_gpu=true --graph=efficientdet/efficientdet-lite1.tflite                                                                  
STARTING!
Log parameter values verbosely: [0]
Graph: [efficientdet/efficientdet-lite1.tflite]
Use gpu: [1]
Loaded model efficientdet/efficientdet-lite1.tflite
INFO: Initialized TensorFlow Lite runtime.
INFO: Created TensorFlow Lite delegate for GPU.
ERROR: Following operations are not supported by GPU delegate:
ADD: OP is supported, but tensor type isn't matched!
ARG_MAX: Operation is not supported.
CAST: Operation is not supported.
GATHER: Operation is not supported.
NON_MAX_SUPPRESSION_V5: Operation is not supported.
STRIDED_SLICE: Slice does not support shrink_axis_mask parameter. 
UNPACK: Operation is not supported.
326 operations will run on the GPU, and the remaining 37 operations will run on the CPU.
>>>
ERROR: TfLiteGpuDelegate Init: STRIDED_SLICE: Output height doesn't match
INFO: Created 0 GPU delegate kernels.
ERROR: TfLiteGpuDelegate Prepare: delegate is not initialized
ERROR: Node number 363 (TfLiteGpuDelegateV2) failed to prepare.
<<<

Additional Notes:

  • model_inspect.py raises no errors when exporting the tflite model
  • Tflite model runs fine on CPU, but fails on GPU
  • I've tested efficientdet-lite0 and the same applies

Steps to Reproduce

Export the pre-trained checkpoint

MODEL = 'efficientdet-lite1'
!wget https://storage.googleapis.com/cloud-tpu-checkpoints/efficientdet/coco/{MODEL}.tgz
!tar zxf {MODEL}.tgz

!python model_inspect.py --runmode=saved_model \
  --model_name={MODEL} --ckpt_path={MODEL} \
  --saved_model_dir={saved_model_dir} --tflite_path={MODEL}.tflite

Run model

Download the android_aarch64 benchmarking binary from the official TF wiki https://www.tensorflow.org/lite/performance/measurement#download_or_build_the_binary

On the Android device, run:

# ./android_aarch64_benchmark_model --use_gpu=true --graph=efficientdet-lite1.tflite

alexdwu13 avatar Sep 14 '21 01:09 alexdwu13