title: Getting class labels from a keras model in R
body: <p>I am developing an image classification workflow which uses keras through R. The workflow will likely be run multiple times, potentially by multiple users. I save a custom trained version of keras' Iv3 model, as a .h5 file.</p>
  <p>Once the file is saved and loaded back in with <code>load_model_hdf5()</code>, is there a way to see the class labels with which the model has been trained?</p>
  <p>I understand that the classes are the alphabetized names of the folders in the training directory but there will be cases where the model is loaded on a new machine without access to the training directory.</p>
  <p>Right now I am manually loading in the list of class labels (as strings) which is not a good solution.</p>
  <p>Ideally, I would load in my trained model and then access a list of class labels...
  pseudocode might look like this</p>
  <pre><code>model_fn &lt;- # some example model file (.h5)
  model &lt;- load_model_hdf5(model_fn) 
  classes &lt;- model$classes
  </code></pre>