title: How do I check the order in which Keras' flow_from_directory method processes folders?
body: <p>When doing transfer learning, I am first feeding the images through the bottom layers of the VGG16 network. I am using a generator function.</p>
  <pre><code>datagen = ImageDataGenerator(1./255)
  generator = datagen.flow_from_directory(
      train_data_dir,
      target_size=(img_width, img_height),
      batch_size = 32,
      class_mode=None,
      shuffle=False
  )
  model.predict_generator(generator, nb_train_samples)
  </code></pre>
  <p>I am setting the class mode to none, because I only want the data output. I am setting shuffle = false, because I want to feed the predicted features later here, and match them up with the ground truth category variable:</p>
  <pre><code>train_data = np.lead(open(file_name, 'rb'))
  train_labels = np.array([0] * NUMBER_OF_ITEMS_FOR_ITEM1 +
                          [1] * NUMBER_OF_ITEMS_FOR_ITEM2 +...
                          [n-1] * NUMBER_OF_ITEMS_FOR_ITEMN
  </code></pre>
  <p>The problem here is that I don't know in which order the files are read. How can I find it out? Or even better yet, how can I just avoid having to guess the correct order? I am asking because I am almost certain that the low prediction accuracy has to do with labels not matching up.</p>