神经网络模型的保存和读取
简略保存过程
...
mode_path = "save/model.ckpt"
...
...
...
#saver 保存模型
saver = tf.train.Saver()
...
...
...
#保持模型的权重和偏移量
save_path = saver.save(sess, model_path)
读取模型
print "第二个session"
with tf.Session() as sess:
sess.run(init)
load_path = saver.restore(sess, model_path###例如 ./save/cnn_train.model-900###)
for epoch in range(7):
...
...
...