原因:saver.restore(sess, tf.train.latest_checkpoint(’/tmp’)),找不到checkpoint所在路径,在restore之前添加判断checkpoint是否存在,若不存在则初始化的判断。
#判断模型保存路径是否存在,不存在就创建
if not os.path.exists('tmp/'):
os.mkdir('tmp/')
#初始化
with tf.Session()
原因:saver.restore(sess, tf.train.latest_checkpoint(’/tmp’)),找不到checkpoint所在路径,在restore之前添加判断checkpoint是否存在,若不存在则初始化的判断。
#判断模型保存路径是否存在,不存在就创建
if not os.path.exists('tmp/'):
os.mkdir('tmp/')
#初始化
with tf.Session()