import tensorflow as tf

#保存模型

saver = tf.train.Saver()

saver.save(sess, "e://code//python//test//package_test//model.ckpt", global_step=step)

#加载读取模型

with tf.Session() as sess:
new_saver=tf.train.import_meta_graph('checkout\\model.ckpt-3500.meta')
new_saver.restore(sess,"E://Code//checkout//./model.ckpt-3500")
sess.run(tf.global_variables_initializer())

 

按windows的常规路径("E://Code//checkout//model.ckpt-3500“)写,可能会出现异常:

Unsuccessful TensorSliceReader constructor: Failed to find any matching files for E:\Code\python\test\package_test\checkout/model.cpk

 posted on 2018-07-02 17:40  庭明  阅读(647)  评论(0编辑  收藏  举报