如何将 MNIST 数据加载到 Google Colab Jupyter Notebook 中?

Ale*_*lex 4 python mnist keras jupyter-notebook google-colaboratory

我有一个在 Google Colab 上运行 Keras 的工作环境,但无法弄清楚如何加载 MNIST 数据,以便我可以将其导入到我的程序中。任何建议非常感谢!

nur*_*ric 7

Keras 具有内置的通用数据集,MNIST 就是其中之一:

from keras.datasets import mnist

(x_train, y_train), (x_test, y_test) = mnist.load_data()
Run Code Online (Sandbox Code Playgroud)

所以如果你在 Colab 上有 Keras,你也应该准备好 MNIST。