tensorflow存储读取神经网络参数
来源:互联网 发布:windows update卡在100 编辑:程序博客网 时间:2024/06/05 15:03
import tensorflow as tf
import numpy as np
#W = tf.Variable([[1,2,3],[3,4,5]], dtype = tf.float32, name='weights')
#b = tf.Variable([[1,2,3]], dtype = tf.float32, name='biases')
#init = tf.global_variables_initializer()
#saver = tf.train.Saver()
#with tf.Session() as sess:
# sess.run(init)
# save_path = saver.save(sess,"my_net/save_net.ckpt")
# print("Save to path:", save_path)
#restore variables
#redefine the same shape and same type for your variables
W = tf.Variable(np.arange(6).reshape((2,3)),dtype = tf.float32, name='weights')
b = tf.Variable(np.arange(3).reshape((1,3)),dtype = tf.float32, name='biases')
#not need init step
saver = tf.train.Saver()
with tf.Session() as sess:
saver.restore(sess, "my_net/save_net.ckpt")
print("weights:", sess.run(W))
print("biases:", sess.run(b))
import numpy as np
#W = tf.Variable([[1,2,3],[3,4,5]], dtype = tf.float32, name='weights')
#b = tf.Variable([[1,2,3]], dtype = tf.float32, name='biases')
#init = tf.global_variables_initializer()
#saver = tf.train.Saver()
#with tf.Session() as sess:
# sess.run(init)
# save_path = saver.save(sess,"my_net/save_net.ckpt")
# print("Save to path:", save_path)
#restore variables
#redefine the same shape and same type for your variables
W = tf.Variable(np.arange(6).reshape((2,3)),dtype = tf.float32, name='weights')
b = tf.Variable(np.arange(3).reshape((1,3)),dtype = tf.float32, name='biases')
#not need init step
saver = tf.train.Saver()
with tf.Session() as sess:
saver.restore(sess, "my_net/save_net.ckpt")
print("weights:", sess.run(W))
print("biases:", sess.run(b))
阅读全文
0 0
- tensorflow存储读取神经网络参数
- Tensorflow变量表示神经网络参数
- 【TensorFlow】神经网络参数与变量(四)
- tensorflow神经网络
- tensorflow的基本用法(十)——保存神经网络参数和加载神经网络参数
- 8.3 TensorFlow BP神经网络构建与超参数的选取
- [Deep Learning] TensorFlow模型、参数的保存与读取
- 从TensorFlow的.ckpt文件中读取网络的参数
- SQL读取存储过程返回的参数
- C# 读取存储过程输出参数
- TensorFlow的 数据和参数的输入 及变量存储
- TensorFlow实现卷积神经网络
- Tensorflow实现卷积神经网络
- tensorflow 卷积神经网络
- Tensorflow实现神经网络
- tensorflow 循环神经网络RNN
- Tensorflow建立简易神经网络
- Tensorflow入门-实现神经网络
- HDU 2059 龟兔赛跑
- 使用Android Killer时遇到的一个奇怪的问题
- Mesh Collider
- hibernate继承映射2
- showModalDialog模态对话框的使用详解以及浏览器兼容
- tensorflow存储读取神经网络参数
- Python eval 函数的使用
- 工作笔记
- mysql的分区和分表
- 查看和修改linux的PATH环境变量的方法
- 入门C#之数据库增删改查I
- NDK开发笔记---CMake构建JNI
- 《社会性动物》之如何让别人喜欢你
- activemq 和webservice 的区别