#coding=utf-8
import tensorflow as tf
tf.app.flags.DEFINE_string('checkpoint_path', 'E:/E/test/src/checkpoint', '')
tf.app.flags.DEFINE_boolean('restore', False, 'whether to resotre from checkpoint')
FLAGS = tf.app.flags.FLAGS
print(FLAGS.checkpoint_path)
if not tf.gfile.Exists(FLAGS.checkpoint_path):
tf.gfile.MkDir(FLAGS.checkpoint_path) #创建目录
else:
if not FLAGS.restore:
tf.gfile.DeleteRecursively(FLAGS.checkpoint_path) #删除该目录下的全部内容
tf.gfile.MkDir(FLAGS.checkpoint_path)