title: tensorflow.keras save model in python and loading in Java
body: <p>I have a fined-tuned vgg model and I created the model using <strong>tensorflow.keras</strong> functional API and saved the model using <em>tf.contrib.saved_model.save_keras_model</em>. 
  So the model is saved with this structure: assets folder which contains <strong>saved_model.json</strong> file, <strong>saved_model.pb</strong> file, and the variables folder, which contain <strong>checkpoint</strong>, <strong>variables.data-00000-of-00001</strong> and <strong>variables.index</strong>.  </p>
  
  <p>I can easily load my model in python and get predictions using <em>tf.contrib.saved_model.load_keras_model(saved_model_path)</em>, but I have no idea how to load the model in JAVA. I googled a lot and found this  <a href="https://stackoverflow.com/questions/45466020/how-to-export-keras-h5-to-tensorflow-pb">How to export Keras .h5 to tensorflow .pb?</a> to export as pb file and then load it up following this link <a href="https://medium.com/@jsflo.dev/saving-and-loading-a-tensorflow-model-using-the-savedmodel-api-17645576527" rel="nofollow noreferrer">Loading in Java</a>.  I was not able to freeze the graph and also I tried to use simple_save but the tensorflow.keras does not support simple_save (<strong>AttributeError: module 'tensorflow.contrib.saved_model' has no attribute 'simple_save'</strong>).  So can someone help me to figure out what steps are needed to load my model (tensorflow.keras functional API model) in JAVA.  </p>
  
  <p>Is the saved_model.pb file that I have, good enough to be loaded on the JAVA side?   Do I need to create my input/output place holders? Then how can I export it?<br>
  I appreciate your help.</p>