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:Codepython estpackage_testcheckout/model.cpk