title: How to get associated image name when using predict_generator() in keras
body: <pre><code>test_batches = ImageDataGenerator(
      preprocessing_function=preprocess_input
  ).flow_from_directory(test_path,target_size=(224,224),batch_size=1,class_mode=None,shuffle = "false")
  prediction = model.predict_generator(test_batches, steps=1, verbose=1)
  np.argmax(prediction)
  </code></pre>
  
  <p>So here I am testing one image by using step_size=1 and steps=1. Whenever I run this I get different predictions, which means it's not picking the same image every time. How can I check the image name?</p>
  
  <p>EDIT: Here's another attempt to explain the problem I am facing:</p>
  
  <pre><code>test_batches = ImageDataGenerator(
      preprocessing_function=preprocess_input
  ).flow_from_directory(test_path,target_size=(224,224),batch_size=2,class_mode=None,shuffle = "false")
  prediction = model.predict_generator(test_batches, steps=1, verbose=2)
  </code></pre>
  
  <p>The prediction variable has two arrays of prediction probabilities. How can I know for which images these predictions are for?</p>