mnist数据集导入常用两种
import numpy as np
import tensorflow as tf
import input_data
mnist_data=input_data.read_data_sets("MNIST_data/",one_hot=True)
mnist=mnist_data
print (type(mnist_data.train.labels[8,:]))
print ((mnist_data.train.labels[8,:])
import numpy as np
import tensorflow as tf
import input_data
mnist_data=input_data.read_data_sets("MNIST_data/")
mnist=mnist_data
print (type(mnist_data.train.labels[8,:]))
print ((mnist_data.train.labels[8,:])
输出为
设置one_hot=True
未设置one_hot=True
one_hot的具体含义:导入数据时,将标签不是用指定的0-9的数字出现的,而是以numpy的数组的格式出现的
参考https://blog.csdn.net/weixin_43364556/article/details/102891072