A solution to print images and labels even when the dataset is batched, "this case ". So here, the variable
imagexd and labelxd will pick a batch from the dataset as shown by test_ds.take(1). Now, to go to this selected batch, we will need a nested for loop, which will run up to the batch_size and print the respective image, along with its label on top.
####
plt.figure(figsize=(10, 10))
for (imagexd, labelxd) in (test_ds.take(1)):
for i in range(batch_size):
yea_image = imagexd[i].numpy().astype("int32")
axd = plt.subplot(4,8, i+1)
plt.imshow(yea_image)
plt.axis("off")
plt.title(f"Label is {int(labelxd[i])}")
####