tensorflow保存模型,加载模型,tensorboard可视化

本文介绍了如何在TensorFlow中保存训练好的模型,并详细讲解了如何加载模型进行测试。同时,还提供了使用TensorBoard进行训练过程可视化的步骤,包括切换到log目录的上一级以及运行tensorboard命令。
摘要由CSDN通过智能技术生成
首先是训练模型保存模型
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 21 12:33:46 2018

@author: FDXK
"""
import sys
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data

max_step = 1000
learning_rate = 0.001
dropout = 0.9

data_dir = 'MNIST_data'
log_dir = 'log'

mnist = input_data.read_data_sets(data_dir, one_hot = True)

sess = tf.InteractiveSession()

with tf.name_scope('input'):
    x = tf.placeholder(tf.float32, [None,784], name = 'x_input')
    print(x)
    y_ = tf.placeholder(tf.float32, [None, 10], name = 'y_input')
    print(y_)
with tf.name_scope('input_reshape'):
    image_shaped_input = tf.reshape(x, [-1, 28, 28, 1])
    tf.summary.image('input', image_shaped_input, 10)
    
def weight_variable(shape):
    initial = tf.truncated_normal(shape, stddev = 0.1)
    return tf.Variabl
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值