TensorFlow 的 Saving&Restoring
来源:互联网 发布:变压器温升计算软件 编辑:程序博客网 时间:2024/05/29 04:17
tf.train.Saver():
v1 = tf.get_variable("v1", shape=[3], initializer = tf.zeros_initializer)
v2 = tf.get_variable("v2", shape=[5], initializer = tf.zeros_initializer)
inc_v1 = v1.assign(v1+1)
dec_v2 = v2.assign(v2-1)
# Add an op to initialize the variables.
init_op = tf.global_variables_initializer()
# Add ops to save and restore all the variables.
saver = tf.train.Saver()
# saver = tf.train.Saver({"v2": v2})
# Later, launch the model, initialize the variables, do some work, and save the
# variables to disk.
with tf.Session()as sess:
sess.run(init_op)
# Do some work with the model.
inc_v1.op.run()
dec_v2.op.run()
# Save the variables to disk.
save_path = saver.save(sess,"/tmp/model.ckpt")
# saver.restore(sess,"/tmp/model.ckpt")
print("Model saved in file: %s" % save_path)
阅读全文
0 0
- TensorFlow 的 Saving&Restoring
- canvas 状态的保存和恢复 Saving and restoring state
- Saving and Restoring android State
- 尝试数据库被标记为RESTORING的处理方式
- SQL server 数据库被标记为RESTORING的处理方式
- SQL server 数据库被标记为RESTORING的处理方式
- 解决挂起的VMware无法恢复:restoring virtual machines
- SQL server 数据库被标记为RESTORING的处理方式
- SQL Server - 数据库恢复的时候停在 Restoring 状态
- Restoring Numbers
- Restoring Painting
- 【TensorFlow】TensorFlow的线性回归
- 【TensorFlow】TensorFlow 的 Logistic Regression
- TensorFlow 完整的TensorFlow入门教程
- [TensorFlow] TensorFlow学习的方向
- saving data - Saving Files
- Restoring Optimizer Statistics
- A. Restoring Password
- 欢迎使用CSDN-markdown编辑器
- PHP零散知识点笔记
- 【c++学习】循环和文本输入
- Unity3D-2
- HDU 6216 A Cubic number and A Cubic Number
- TensorFlow 的 Saving&Restoring
- 2017 青岛网络赛 Smallest Minimum Cut 最大流最小割问题, (加深理解最大流问题)
- 9.17 进阶hive 理论知识
- 单点登录
- 09.17周日
- 计科学习路—计算机中内存、cache和寄存器之间的关系及区别
- 第三周【项目1
- 深度学习DeepLearning.ai系列课程学习总结:5. 浅层神经网络
- write operations are not allowed in read-only mode(flushMode.MANUAL)