title: How to extract classes from prefetched dataset in Tensorflow for confusion matrix
body: <p>I was trying to plot a confusion matrix for my image classifier with the following code but I got an error message: 'PrefetchDataset' object has no attribute 'classes'</p>
  <pre><code>Y_pred = model.predict(validation_dataset)
  y_pred = np.argmax(Y_pred, axis=1)
  
  print('Confusion Matrix')
  print(confusion_matrix(validation_dataset.classes, y_pred)) # ERROR message generated
  </code></pre>
  <blockquote>
  <p>PrefetchDataset' object has no attribute 'classes'</p>
  </blockquote>