sergiomsilva / alpr-unconstrained

License Plate Detection and Recognition in Unconstrained Scenarios

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting this working on Edge TPU

sinclairnick opened this issue · comments

Hey Sergio,

Good work on the research.

I've been trying to port this to Edge TPU using the TFLite converter and compiler. Although you may not be familiar with this in particular, you may be able to help.

Firstly, did you end up getting the MobileNet version to converge? As I think this would work on Edge TPU.

If not, given my current converter settings,

    converter = tf.lite.TFLiteConverter.from_keras_model(model)
    # required for edgetpu compatibility
    converter.representative_dataset = representative_dataset_gen
    converter.optimizations = [tf.lite.Optimize.OPTIMIZE_FOR_SIZE]
    converter.target_spec.supported_ops = [tf.lite.OpsSet.TFLITE_BUILTINS_INT8]
    converter.experimental_new_converter = True
    converter.experimental_new_quantizer = True
    converter.inference_input_type = tf.uint8
    converter.inference_output_type = tf.uint8
    tflite_model = converter.convert()

I get the error:

RuntimeError: Failed to quantize: <unknown>:0: error: loc("model_1/conv2d_25/Exp"): 'tfl.exp' op requires the same type for all operands and results

when I try to compile the model.

Given your familiarity with the model you created, do you have any ideas as to why this might be occurring?

Thanks in advance