下载MNIST数据

1.导入Keras相关模块

import numpy as np
import pandas as pd
from keras.utils import np_utils
from keras.datasets import mnist
2.下载并验证数据

(X_train_image,y_train_label),(X_test_image,y_test_label) = mnist.load_data()
print('train data=',len(X_train_image))
print('test data=',len(X_test_image))
 
 
Using TensorFlow backend.
Downloading data from https://s3.amazonaws.com/img-datasets/mnist.npz
 
train data= 60000
test data= 10000