title: tf.keras.models.save_model and optimizer warning
body: <p>I created a <strong>Sequential</strong> model using <code>tf.keras</code> as follows:</p>
  
  <pre><code>model = tf.keras.Sequential()
  model.add(tf.keras.layers.Dense(8, input_dim=4))
  model.add(tf.keras.layers.Dense(3, activation=tf.nn.softmax))
  
  opt = tf.train.AdamOptimizer(learning_rate=0.001)
  model.compile(optimizer=opt, loss="categorical_crossentropy", metrics=["accuracy"])
  
  model.summary()
  </code></pre>
  
  <p>After that, I created a training process using <code>train_on_batch</code>:</p>
  
  <pre><code>EPOCHS=50
  for epoch in range(EPOCHS):
    for metrics, labels in dataset:
      # Calculate training loss and accuracy
      tr_loss, tr_accuracy = model.train_on_batch(metrics, labels)
  </code></pre>
  
  <p>When I try to save the model, I receive a warning. I can't understand why, because I included the optimizer as part of the <code>model.compile</code>:</p>
  
  <pre><code>tf.keras.models.save_model(
      model,
      "./model/iris_model.h5",
      overwrite=True,
      include_optimizer=True
  )
  </code></pre>
  
  <blockquote>
    <p>WARNING:tensorflow:TensorFlow optimizers do not make it possible to access optimizer attributes or optimizer state after instantiation. As a result, we cannot save the optimizer as part of the model save file.You will have to compile your model again after loading it. Prefer using a Keras optimizer instead (see keras.io/optimizers).</p>
  </blockquote>
  
  <p>The TF version I used is 1.9.0-rc2.</p>