运行环境:windows,tensorflow - gpu-1.13.1
#---------------------------------理解mnist数据集
#导入mnist数据集
from tensorflow.examples.tutorials.mnist import input_data #从网上下载mnist数据集的模块
mnist = input_data.read_data_sets('MNIST_data/',one_hot = False) #从指定文件夹导入数据集的数据
##分析mnist数据集
#print('输入训练数据集数据:',mnist.train.images) #打引导如数据集的数据
#print('输入训练数据集shape:',mnist.train.images.shape) #打印训练数据集的形状
#print('输入测试数据集shape:',mnist.test.images.shape) #用于评估训练过程中的准确度
#print('输入验证数据集shape:',mnist.validation.images.shape) #用于评估最终模型的准确度
#print('输入标签的shape:',mnist.train.labels.shape)
#展示mnist数据集
#import pylab
#im = mnist.test.images[6] #train中的第六张图
#im = im.reshape(-1,28)
#pylab.imshow(im)
#pylab.show()
#-----------------------------------------------
#-------------------------------正向传播结构
import tensorflow as tf
tf.reset_default_graph()
#分析图片特点定义变量
#define placeholder
x = tf.placeholder(tf.float32,[None, 784]

本文介绍如何使用TensorFlow在Windows环境下加载并分析MNIST数据集,通过定义正向传播结构、反向传播参数,实现对MNIST数据集的手写数字识别,并通过200个训练周期对模型进行训练。
最低0.47元/天 解锁文章
1817

被折叠的 条评论
为什么被折叠?



