这是tf入门的第一个例子。minst应该是内置的数据集。
前置知识在学习笔记(1)里面讲过了
这里直接上代码
1 # -*- coding: utf-8 -*- 2 """ 3 Created on Fri May 25 14:09:45 2018 4 5 @author: Administrator 6 """ 7 #导入数据集 8 from tensorflow.examples.tutorials.mnist import input_data 9 mnist=input_data.read_data_sets("MNIST_data/",one_hot=True) 10 #打印数据集的详情 11 print(mnist.train.images.shape,mnist.train.labels.shape) 12 print(mnist.test.images.shape,mnist.test.labels.shape) 13 print(mnist.validation.images.shape,mnist.validation.labels.shape)
打印结果如下
第一个是训练集的特征值和标签,第二个是测试集,第三个是验证集
深度学习-tensorflow学习笔记(2)-MNIST手写字体识别
原文:https://www.cnblogs.com/DJC-BLOG/p/9093913.html