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