title: how do you output images from a Batchdataset of images in keras
body: <p>After creating a dataset of images using image_dataset_from_directory from keras, how do you get the first image out of the dataset in a numpy format that you can display using pyplot.imshow?</p>
  <pre><code>import tensorflow as tf
  import matplotlib.pyplot as plt
  
  test_data = tf.keras.preprocessing.image_dataset_from_directory(
      &quot;C:\\Users\\Admin\\Downloads\\kagglecatsanddogs_3367a&quot;,
      validation_split=.1,
      subset='validation',
      seed=123)
  for e in test_data.as_numpy_iterator():
      print(e[1:])
  </code></pre>