当我使用tensorflow restore时,请按以下方式运行代码,每次运行都会产生不同的结果。
import tensorflow as tf
ckpt = tf.train.get_checkpoint_state("./models/")
saver = tf.train.import_meta_graph(ckpt.model_checkpoint_path + '.meta')
with tf.Session() as sess:
saver.restore(sess, ckpt.model_checkpoint_path)
weights = sess.run(tf.get_default_graph().get_tensor_by_name('output_weights/obj_w:0'))
print(weights[0])