diff --git a/PaddleCV/PaddleDetection/tools/train.py b/PaddleCV/PaddleDetection/tools/train.py index 11167a327c7d3c4cf7196352bd05bacbc0f04f6e..6dc0f1ede87a8dd174fef4776c87424ab70c257e 100644 --- a/PaddleCV/PaddleDetection/tools/train.py +++ b/PaddleCV/PaddleDetection/tools/train.py @@ -99,7 +99,7 @@ def main(): device_id = int(env['FLAGS_selected_gpus']) else: device_id = 0 - place = fluid.CUDAPlace(device_id) + place = fluid.CUDAPlace(device_id) if cfg.use_gpu else fluid.CPUPlace() exe = fluid.Executor(place) lr_builder = create('LearningRate') @@ -164,8 +164,8 @@ def main(): # local execution scopes can be deleted after each iteration. exec_strategy.num_iteration_per_drop_scope = 1 if FLAGS.dist: - dist_utils.prepare_for_multi_process( - exe, build_strategy, startup_prog, train_prog) + dist_utils.prepare_for_multi_process(exe, build_strategy, startup_prog, + train_prog) exec_strategy.num_threads = 1 exe.run(startup_prog) @@ -187,10 +187,8 @@ def main(): elif cfg.pretrain_weights: checkpoint.load_pretrain(exe, train_prog, cfg.pretrain_weights) - train_reader = create_reader( - train_feed, - (cfg.max_iters - start_iter) * devices_num, - FLAGS.dataset_dir) + train_reader = create_reader(train_feed, (cfg.max_iters - start_iter) * + devices_num, FLAGS.dataset_dir) train_pyreader.decorate_sample_list_generator(train_reader, place) # whether output bbox is normalized in model output layer