How can I import the MNIST dataset that has been manually downloaded?

前端 未结 4 1119
北海茫月
北海茫月 2021-02-05 18:36

I have been experimenting with a Keras example, which needs to import MNIST data

from keras.datasets import mnist
import numpy as np
(x_train, _), (x_test, _) =          


        
4条回答
  •  既然无缘
    2021-02-05 19:02

    1. Download file https://s3.amazonaws.com/img-datasets/mnist.npz
    2. Move mnist.npz to .keras/datasets/ directory
    3. Load data

      import keras
      from keras.datasets import mnist
      
      (X_train, y_train), (X_test, y_test) = mnist.load_data()
      

提交回复
热议问题