How can Tensorflow and Python be used to verify the CIFAR dataset?

PythonServer Side ProgrammingProgrammingTensorflow

The CIFAR dataset can be verified by plotting the images present in the dataset on the console. Since the CIFAR labels are arrays, an extra index would be needed. The ‘imshow’ method from the ‘matplotlib’ library is used to display the image.

Read More: What is TensorFlow and how Keras work with TensorFlow to create Neural Networks?

We are using the Google Colaboratory to run the below code. Google Colab or Colaboratory helps run Python code over the browser and requires zero configuration and free access to GPUs (Graphical Processing Units). Colaboratory has been built on top of Jupyter Notebook.

print("Verifying the data")
print("Plot the first 15 images")
print("An extra index is needed since CIFAR labels are arrays")
for i in range(15):

Code credit:


Verifying the data
Plot the first 15 images
An extra index is needed since CIFAR labels are arrays


  • The data which is normalized, is visualized.
  • This is done using the 'matplotlib' library.
Updated on 20-Feb-2021 07:02:36