From 94299aa8774717838bb3613105b29bb09dcfbdd0 Mon Sep 17 00:00:00 2001 From: Kaipeng Deng Date: Mon, 16 Sep 2019 10:41:43 +0800 Subject: [PATCH] fix multi-process reader not exist in resume (#3323) --- tools/train.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/train.py b/tools/train.py index b6215931c..52062f338 100644 --- a/tools/train.py +++ b/tools/train.py @@ -103,10 +103,6 @@ def main(): optimizer = optim_builder(lr) optimizer.minimize(loss) - train_reader = create_reader(train_feed, cfg.max_iters * devices_num, - FLAGS.dataset_dir) - train_pyreader.decorate_sample_list_generator(train_reader, place) - # parse train fetches train_keys, train_values, _ = parse_fetches(train_fetches) train_values.append(lr) @@ -163,6 +159,13 @@ 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_pyreader.decorate_sample_list_generator(train_reader, place) + + # whether output bbox is normalized in model output layer is_bbox_normalized = False if hasattr(model, 'is_bbox_normalized') and \ -- GitLab