File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -460,15 +460,20 @@ def _parse_flagfile():
460
460
with tf .gfile .Open (flagfile , "r" ) as f :
461
461
# This overrides FLAGS with flags from flagfile.
462
462
flags .FLAGS ([__file__ ] + f .read ().splitlines ())
463
+ return flagfile
463
464
464
465
465
466
def main (_ ):
466
467
global _log_file
467
- _parse_flagfile ()
468
+ flagfile = _parse_flagfile ()
468
469
469
470
redirect_logs = flags .FLAGS .redirect_logs
470
471
cache_paths = rconst .Paths (
471
472
data_dir = flags .FLAGS .data_dir , cache_id = flags .FLAGS .cache_id )
473
+ # Rename flagfile so the next run at the same data_dir will still work.
474
+ flagfile_with_id = flagfile + "_" + cache_paths .cache_id
475
+ tf .gfile .Rename (flagfile , flagfile_with_id )
476
+ tf .logging .info ("Moving flagfile to {}." .format (flagfile_with_id ))
472
477
473
478
log_file_name = "data_gen_proc_{}.log" .format (cache_paths .cache_id )
474
479
log_path = os .path .join (cache_paths .data_dir , log_file_name )
You can’t perform that action at this time.
0 commit comments