title: Converting saved_model to TFLite model using TF 2.0
body: <p>currently I am working on converting custom object detection model (trained using SSD and inception network) to quantized TFLite model. I can able to convert custom object detection model from frozen graph to quantized TFLite model using the following code snippet (using <strong>Tensorflow 1.4</strong>):</p>
  
  <pre><code>converter = tf.lite.TFLiteConverter.from_frozen_graph(args["model"],input_shapes = {'normalized_input_image_tensor':[1,300,300,3]},
  input_arrays = ['normalized_input_image_tensor'],output_arrays = ['TFLite_Detection_PostProcess','TFLite_Detection_PostProcess:1',
  'TFLite_Detection_PostProcess:2','TFLite_Detection_PostProcess:3'])
  
  converter.allow_custom_ops=True
  converter.post_training_quantize=True 
  tflite_model = converter.convert()
  open(args["output"], "wb").write(tflite_model)
  </code></pre>
  
  <p>However <code>tf.lite.TFLiteConverter.from_frozen_graph</code> class method is not available for <strong>Tensorflow 2.0</strong> (<a href="https://www.tensorflow.org/lite/convert/python_api#exporting_a_savedmodel_" rel="nofollow noreferrer">refer this link</a>). So I tried to convert the model using <code>tf.lite.TFLiteConverter.from_saved_model</code> class method. The code snippet is shown below:</p>
  
  <pre><code>converter = tf.lite.TFLiteConverter.from_saved_model("/content/") # Path to saved_model directory
  converter.optimizations =  [tf.lite.Optimize.DEFAULT]
  tflite_model = converter.convert()
  </code></pre>
  
  <p>The above code snippet throws the following error:</p>
  
  <pre><code>ValueError: None is only supported in the 1st dimension. Tensor 'image_tensor' has invalid shape '[None, None, None, 3]'.
  </code></pre>
  
  <p>I tried to pass <code>input_shapes</code> as argument </p>
  
  <p><code>converter = tf.lite.TFLiteConverter.from_saved_model("/content/",input_shapes={"image_tensor" : [1,300,300,3]})</code> </p>
  
  <p>but it throws the following error:</p>
  
  <pre><code>TypeError: from_saved_model() got an unexpected keyword argument 'input_shapes'
  </code></pre>
  
  <p>Am I missing something? Please feel free to correct me!</p>