#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)
tensorflow gfile 目录操作
tensorflow相关文章
最近热门
最常浏览
- 016 推荐系统 | 排序学习(LTR - Learning To Rank)
- 偏微分符号
- i.i.d(又称IID)
- 利普希茨连续条件(Lipschitz continuity)
- (error) MOVED 原因和解决方案
- TextCNN详解
- 找不到com.google.protobuf.GeneratedMessageV3的类文件
- Deployment failed: repository element was not specified in the POM inside distributionManagement
- cannot access com.google.protobuf.GeneratedMessageV3 解决方案
- CLUSTERDOWN Hash slot not served 问题原因和解决办法
×