[Jupyter], Tensorflow 1.8 loads the MNIST dataset

# 导入包
import tensorflow as tf 
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/",one_hot=True)

This click-in operation may take a relatively long time, so I first download the required data set

The URL is: http://yann.lecun.com/exdb/mnist/

 

Click the four red links in the picture to download.

 

Find the file storage directory of jupyter, here I created a jupyter_project to store the files in jupyter, create a new MNIST_data folder, and paste the four compressed packages directly. About modifying the working directory of jupyter, you can see my article https://blog.csdn.net/weixin_43951831/article/details/105127406

 

 

Then execute the code at the beginning and import the data set, the speed will be faster

 

Extracting xxx appears in the result, which means that the content inside the decompression read is read, so basically the MNIST data set is loaded.

 

You can try to view the content inside

print('训练集 train 数量:',mnist.train.num_examples,
     ',验证集 validation 数量:',mnist.validation.num_examples,
     ',测试集 test 数量:',mnist.test.num_examples)

Published 16 original articles · Likes0 · Visits 445

Guess you like

Origin blog.csdn.net/weixin_43951831/article/details/105185655