title: Unable to properly convert tf.keras model to quantized format for coral TPU
body: <p>I'am trying to convert a <strong>tf.keras</strong> model based on <strong>mobilenetv2</strong> with <strong>transpose convolution</strong> using latest <strong>tf-nighlty</strong>. Here is the conversion code</p>
  
  <pre><code>#saved_model_dir='/content/ksaved'  # tried from saved model also
  #converter = tf.lite.TFLiteConverter.from_saved_model(saved_model_dir)
  
  converter = tf.lite.TFLiteConverter.from_keras_model(reshape_model)
  converter.experimental_new_converter=True
  converter.optimizations = [tf.lite.Optimize.DEFAULT]
  converter.target_spec.supported_ops = [tf.lite.OpsSet.TFLITE_BUILTINS_INT8]
  converter.inference_input_type = tf.uint8
  converter.inference_output_type = tf.uint8
  
  converter.representative_dataset = representative_dataset_gen
  
  tflite_quant_modell = converter.convert()
  open("/content/model_quant.tflite", "wb").write(tflite_quant_modell)
  </code></pre>
  
  <p>The conversion was successful(in google colab); but it has <strong>quantize and dequantize operators at the ends</strong>(as seen using netron). All operators seems to be supported. <strong>Representative data set</strong> images are float32 in generator and the model has a 4 channel float32 input by default. It looks like we need a <strong>UINT8 input and output</strong> inside model for <strong>coral TPU</strong>. How can we properly carry out this conversion?</p>
  
  <p>Ref:-</p>
  
  <ol>
  <li><p><a href="https://www.tensorflow.org/lite/performance/post_training_quantization#full_integer_quantization_of_weights_and_activations" rel="nofollow noreferrer">Full integer quantization of weights and activations</a></p></li>
  <li><p><a href="https://stackoverflow.com/questions/56856262/how-to-quantize-inputs-and-outputs-of-optimized-tflite-model">How to quantize inputs and outputs of optimized tflite model</a></p></li>
  <li><p><a href="https://stackoverflow.com/questions/56870564/coral-edge-tpu-compiler-cannot-convert-tflite-model-model-not-quantized">Coral Edge TPU Compiler cannot convert tflite model: Model not quantized</a></p></li>
  </ol>
  
  <p>I tried with 'tf.compat.v1.lite.TFLiteConverter.from_keras_model_file' instead of v2 version.I got error: "<strong>Quantization not yet supported for op: TRANSPOSE_CONV</strong>" while trying to quantize the model in latest tf 1.15 (using representative dataset) and "<strong>Internal compiler error. Aborting!</strong> " from coral tpu compiler using tf2.0 quantized tflite</p>
  
  <p>Tflite model @ <a href="https://github.com/tensorflow/tensorflow/issues/31368" rel="nofollow noreferrer">https://github.com/tensorflow/tensorflow/issues/31368</a> </p>
  
  <p><a href="https://i.stack.imgur.com/Apgeu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Apgeu.png" alt="enter image description here"></a></p>
  
  <p>It seems to work until the <strong>last constitutional block</strong> (1x7x7x160)
  The compiler error(Aborting) does not give any information regarding the potential cause and all types of convolutional layers seems to be supported as per coral docs.</p>
  
  <p>Coral doc: <a href="https://coral.ai/docs/edgetpu/models-intro/#quantization" rel="nofollow noreferrer">https://coral.ai/docs/edgetpu/models-intro/#quantization</a></p>