How do I load MNIST data into a Google Colab Jupyter Notebook?

Viewed 9078

I've got a working environment for running Keras on Google Colab, but cannot figure out how to load MNIST data so I can import it into my program. Any suggestions greatly appreciated!

1 Answers

Keras has built-in common datasets and MNIST is one of them:

from keras.datasets import mnist

(x_train, y_train), (x_test, y_test) = mnist.load_data()

So if you have Keras on Colab, you should also have MNIST ready to go.

Related