edgetpu: Internal compiler error. Aborting!

I’m trying to compile a deeplab model (mobilenetv2), but I always get this error

Edge TPU Compiler version 2.0.291256449

Internal compiler error. Aborting! 

Code for the conversion to tflite. This tflite model works fine.

tflite_convert \
--graph_def_file=$INPUT \
--output_file=$OUTPUT \
  --output_format=TFLITE \
  --input_shape=1,420,513,3 \
  --input_arrays="MobilenetV2/MobilenetV2/input" \
  --inference_type=QUANTIZED_UINT8 \
  --std_dev_values=128 \
  --mean_values=128 \
  --change_concat_input_ranges=true \
  --output_arrays="ArgMax"

I’m using TF 1.15.

model.tflite

Thanks for your help!

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 17

Most upvoted comments

Using Edge TPU Compiler version 2.1.302470888

I think this error may have something to do with activation range estimation. Consider:

import tensorflow as tf

@tf.function
def f(x):
  return x*2.0

cf = f.get_concrete_function(tf.zeros(8))
converter = tf.lite.TFLiteConverter([cf])
def representative_dataset_gen():
  yield [tf.random.uniform([8])]  # <- Compiles successfully
  # yield [tf.zeros([8])]  # Internal compiler error. Aborting! 

converter.representative_dataset = representative_dataset_gen
converter.optimizations = [tf.lite.Optimize.DEFAULT]
converter.target_spec.supported_ops = [tf.lite.OpsSet.TFLITE_BUILTINS_INT8]
converter.target_spec.supported_types = [tf.int8]
tflite_quant_model = converter.convert()
open('model.tflite', 'wb').write(tflite_quant_model)

!edgetpu_compiler model.tflite