title: Converting Keras Model Weights and Architecture to TensorFlow Lite Model
body: <p>I have Keras Model in terms of Model Weights stored in model.h5 and Model Architecture stored in model.json , my aim is to covert these two files that makes up Keras model to tensorflow Lite Model, I have tried several ways but it does not seem to work.</p>
  
  <p>When I use Tensoflow 1.15.0 with the following code I get "NameError: name 'lite' is not defined" and when I downgrade to Tensoflow 1.15.0 I get 
  "AttributeError: type object 'TFLiteConverter' has no attribute 'from_keras_model'"</p>
  
  <p>can anybody help Thanks in advance!</p>
  
  <pre><code>#from tensorflow.contrib import lite 
  import tensorflow as tf
  
  from tensorflow.contrib import lite
  
  from keras.models import model_from_json
  # Model reconstruction from JSON file
  with open('drive/My Drive/Colab Notebooks/model.json', 'r') as f:
      model = model_from_json(f.read())
  
  # Load weights into the new model
  model.load_weights('drive/My Drive/Colab Notebooks/model.h5')
  
  # Converting a tf.Keras model to a TensorFlow Lite model.
  converter = lite.TFLiteConverter.from_keras_model(model)
  tflite_model = converter.convert()
  </code></pre>