如果我已经通过
来查看某个节点的数据,然后print来输出,只是多了一个saver.restore而已,其他的没有什么区别。
,,
saver = tf.train.Saver()
保存了一个模型,然后我要读取模型,代码如下
saver = tf.train.Saver()
gpu_options = tf.GPUOptions(allow_growth=True)
with tf.Session(config=tf.ConfigProto(log_device_placement=False, allow_soft_placement=True,
gpu_options=gpu_options)) as sess:
saver.restore(sess,'/home/user/python/tensorflow_1/tensorflow_exercise/model/cifar_new8.ckpt')
# sess.run(init_op)
images_batch, labels_batch=sess.run([images_test, labels_test])
aaa=sess.run(images_holder,feed_dict={images_holder:images_batch,labels_holder:labels_batch})
print(aaa)
print("训练完毕!")
saver,restore的是原来保存的模型,其实回收的模型和普通的网络设计是一样的,也需要通过
sess.run来传递数据,然后
sess.run
来查看某个节点的数据,然后print来输出,只是多了一个saver.restore而已,其他的没有什么区别。
,,