From e4a5f37a7e09b48a3a1a85f2093dade7ee3114b5 Mon Sep 17 00:00:00 2001 From: Leo Xiao Date: Thu, 11 Apr 2019 10:46:52 +0800 Subject: [PATCH] delete useless code --- tools/train.py | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/tools/train.py b/tools/train.py index 50e8273f..039c5487 100755 --- a/tools/train.py +++ b/tools/train.py @@ -73,37 +73,10 @@ def parse_args(): return args -def copy_prev_models(prev_models_dir, model_dir): - import shutil - - vc_folder = '/hdfs/' \ - + '/' + os.environ['PHILLY_VC'] - source = prev_models_dir - # If path is set as "sys/jobs/application_1533861538020_2366/models" prefix with the location of vc folder - source = vc_folder + '/' + source if not source.startswith(vc_folder) \ - else source - destination = model_dir - - if os.path.exists(source) and os.path.exists(destination): - for file in os.listdir(source): - source_file = os.path.join(source, file) - destination_file = os.path.join(destination, file) - if not os.path.exists(destination_file): - print("=> copying {0} to {1}".format( - source_file, destination_file)) - shutil.copytree(source_file, destination_file) - else: - print('=> {} or {} does not exist'.format(source, destination)) - - def main(): args = parse_args() update_config(cfg, args) - if args.prevModelDir and args.modelDir: - # copy pre models for philly - copy_prev_models(args.prevModelDir, args.modelDir) - logger, final_output_dir, tb_log_dir = create_logger( cfg, args.cfg, 'train')