Cannot get MNIST database through Anaconda/jupyter

前端 未结 9 2576
情歌与酒
情歌与酒 2021-02-13 14:20

Hu guys,

I\'m new to python/anaconda/jupyter/numPy, panda, etc.... so please excuse me if it\'s a really stupid question. I\'m trying to obtain MNIST database by using a

9条回答
  •  长情又很酷
    2021-02-13 14:44

    I found this solution on https://github.com/ageron/handson-ml/issues/7 and this one was most useful for me. Just download the file from https://github.com/amplab/datascience-sp14/raw/master/lab7/mldata/mnist-original.mat

    after that use this script:

    from scipy.io import loadmat
    mnist_path = "my/local/path/mnist-original.mat" #type the directory where you want to the file is located
    mnist_raw = loadmat(mnist_path)
    mnist = {
    "data": mnist_raw["data"].T,
    "target": mnist_raw["label"][0],
    "COL_NAMES": ["label", "data"],
    "DESCR": "mldata.org dataset: mnist-original",
    }
    print("Success!")
    

提交回复
热议问题