title: Converting saved_model.pb to model.tflite
body: <p>Tensorflow Version: 2.2.0</p>
  <p>OS: Windows 10</p>
  <p>I am trying to convert a saved_model.pb to a tflite file.</p>
  <p>Here is the code I am running:</p>
  <pre><code>import tensorflow as tf
  
  # Convert
  converter = tf.lite.TFLiteConverter.from_saved_model(saved_model_dir='C:\Data\TFOD\models\ssd_mobilenet_v2_quantized')
  tflite_model = converter.convert()
  
  
  fo = open(&quot;model.tflite&quot;, &quot;wb&quot;)
  fo.write(tflite_model)
  fo.close
  </code></pre>
  <p>This code gives an error while converting:</p>
  <pre><code>  File &quot;C:\Users\Mr.Ace\AppData\Roaming\Python\Python38\site-packages\tensorflow\lite\python\convert.py&quot;, line 196, in toco_convert_protos
      model_str = wrap_toco.wrapped_toco_convert(model_flags_str,
    File &quot;C:\Users\Mr.Ace\AppData\Roaming\Python\Python38\site-packages\tensorflow\lite\python\wrap_toco.py&quot;, line 32, in wrapped_toco_convert
      return _pywrap_toco_api.TocoConvert(
  Exception: &lt;unknown&gt;:0: error: loc(&quot;Func/StatefulPartitionedCall/input/_0&quot;): requires all operands and results to have compatible element types
  &lt;unknown&gt;:0: note: loc(&quot;Func/StatefulPartitionedCall/input/_0&quot;): see current operation: %1 = &quot;tf.Identity&quot;(%arg0) {device = &quot;&quot;} : (tensor&lt;1x?x?x3x!tf.quint8&gt;) -&gt; tensor&lt;1x?x?x3xui8&gt;
  
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File &quot;c:/Data/TFOD/convert.py&quot;, line 13, in &lt;module&gt;
      tflite_model = converter.convert()
    File &quot;C:\Users\Mr.Ace\AppData\Roaming\Python\Python38\site-packages\tensorflow\lite\python\lite.py&quot;, line 1076, in convert
      return super(TFLiteConverterV2, self).convert()
    File &quot;C:\Users\Mr.Ace\AppData\Roaming\Python\Python38\site-packages\tensorflow\lite\python\lite.py&quot;, line 899, in convert
      return super(TFLiteFrozenGraphConverterV2,
    File &quot;C:\Users\Mr.Ace\AppData\Roaming\Python\Python38\site-packages\tensorflow\lite\python\lite.py&quot;, line 629, in convert
      result = _toco_convert_impl(
    File &quot;C:\Users\Mr.Ace\AppData\Roaming\Python\Python38\site-packages\tensorflow\lite\python\convert.py&quot;, line 569, in toco_convert_impl
      data = toco_convert_protos(
    File &quot;C:\Users\Mr.Ace\AppData\Roaming\Python\Python38\site-packages\tensorflow\lite\python\convert.py&quot;, line 202, in toco_convert_protos
      raise ConverterError(str(e))
  tensorflow.lite.python.convert.ConverterError: &lt;unknown&gt;:0: error: loc(&quot;Func/StatefulPartitionedCall/input/_0&quot;): requires all operands and results to have compatible element types
  &lt;unknown&gt;:0: note: loc(&quot;Func/StatefulPartitionedCall/input/_0&quot;): see current operation: %1 = &quot;tf.Identity&quot;(%arg0) {device = &quot;&quot;} : (tensor&lt;1x?x?x3x!tf.quint8&gt;) -&gt; tensor&lt;1x?x?x3xui8&gt;
  </code></pre>