title: Find the number of epochs of a loaded Keras model
body: <p>I usually load my Keras models using the load_model() method. Is it possible to obtain the number of epochs a model was trained for after loading it again?</p>
  
  <p>This <a href="https://github.com/keras-team/keras/issues/1766" rel="nofollow noreferrer">GitHub issue</a> mentions the following hack:</p>
  
  <pre><code>r = model.fit(X_train,y_train,epochs=5)
  n_epochs = len(r.history['loss'])
  </code></pre>
  
  <p>However, that's not exactly what I want as I would like to obtain the number of epochs from the loaded models.</p>