首页 > 编程语言 > 详细

吴裕雄 python 神经网络——TensorFlow variables_to_restore函数的使用样例

时间:2019-05-16 14:43:15      阅读:280      评论:0      收藏:0      [点我收藏+]
import tensorflow as tf

v = tf.Variable(0, dtype=tf.float32, name="v")
ema = tf.train.ExponentialMovingAverage(0.99)
print(ema.variables_to_restore())

saver = tf.train.Saver({"v/ExponentialMovingAverage": v})
with tf.Session() as sess:
    saver.restore(sess, "E:\\Saved_model\\model2.ckpt")
    print(sess.run(v))

技术分享图片

 

吴裕雄 python 神经网络——TensorFlow variables_to_restore函数的使用样例

原文:https://www.cnblogs.com/tszr/p/10875135.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!