提交 0d1721e6 编写于 作者: S still-wait

clean useless log in DataLoader

上级 5549e083
...@@ -13,6 +13,9 @@ __pycache__/ ...@@ -13,6 +13,9 @@ __pycache__/
# json file # json file
*.json *.json
# log file
*.log
# Distribution / packaging # Distribution / packaging
/bin/ /bin/
/build/ /build/
......
...@@ -406,7 +406,7 @@ reader = create_reader(cfg.EvalReader) ...@@ -406,7 +406,7 @@ reader = create_reader(cfg.EvalReader)
# infer # infer
reader = create_reader(cfg.TestReader) reader = create_reader(cfg.TestReader)
# 将reader设置为DataLoader数据源 # 将reader设置为DataLoader数据源
loader.set_sample_list_generator(reader, place) loader.set_sample_list_generator(reader)
``` ```
在运行程序中设置完数据处理模块后,就可以开始训练、评估与测试了,具体请参考相应运行程序python源码。 在运行程序中设置完数据处理模块后,就可以开始训练、评估与测试了,具体请参考相应运行程序python源码。
......
...@@ -160,7 +160,8 @@ def main(): ...@@ -160,7 +160,8 @@ def main():
start_iter = 0 start_iter = 0
train_reader = create_reader(cfg.TrainReader, (cfg.max_iters - start_iter) * train_reader = create_reader(cfg.TrainReader, (cfg.max_iters - start_iter) *
devices_num, cfg) devices_num, cfg)
train_loader.set_sample_list_generator(train_reader, place) # When iterable mode, set set_sample_list_generator(train_reader, place)
train_loader.set_sample_list_generator(train_reader)
# get all student variables # get all student variables
student_vars = [] student_vars = []
...@@ -183,7 +184,8 @@ def main(): ...@@ -183,7 +184,8 @@ def main():
eval_prog = eval_prog.clone(True) eval_prog = eval_prog.clone(True)
eval_reader = create_reader(cfg.EvalReader) eval_reader = create_reader(cfg.EvalReader)
eval_loader.set_sample_list_generator(eval_reader, place) # When iterable mode, set set_sample_list_generator(eval_reader, place)
eval_loader.set_sample_list_generator(eval_reader)
# parse eval fetches # parse eval fetches
extra_keys = [] extra_keys = []
......
...@@ -149,7 +149,8 @@ def main(): ...@@ -149,7 +149,8 @@ def main():
start_iter = 0 start_iter = 0
train_reader = create_reader(cfg.TrainReader, (cfg.max_iters - start_iter) * train_reader = create_reader(cfg.TrainReader, (cfg.max_iters - start_iter) *
devices_num, cfg) devices_num, cfg)
train_loader.set_sample_list_generator(train_reader, place) # When iterable mode, set set_sample_list_generator(train_reader, place)
train_loader.set_sample_list_generator(train_reader)
eval_prog = fluid.Program() eval_prog = fluid.Program()
with fluid.program_guard(eval_prog, fluid.default_startup_program()): with fluid.program_guard(eval_prog, fluid.default_startup_program()):
...@@ -161,7 +162,8 @@ def main(): ...@@ -161,7 +162,8 @@ def main():
eval_prog = eval_prog.clone(True) eval_prog = eval_prog.clone(True)
eval_reader = create_reader(cfg.EvalReader) eval_reader = create_reader(cfg.EvalReader)
eval_loader.set_sample_list_generator(eval_reader, place) # When iterable mode, set set_sample_list_generator(eval_reader, place)
eval_loader.set_sample_list_generator(eval_reader)
teacher_cfg = load_config(FLAGS.teacher_config) teacher_cfg = load_config(FLAGS.teacher_config)
merge_config(FLAGS.opt) merge_config(FLAGS.opt)
......
...@@ -296,7 +296,8 @@ def main(): ...@@ -296,7 +296,8 @@ def main():
fetches = archs(feed_vars, 'eval', cfg) fetches = archs(feed_vars, 'eval', cfg)
eval_prog = eval_prog.clone(True) eval_prog = eval_prog.clone(True)
eval_loader.set_sample_list_generator(eval_reader, place) # When iterable mode, set set_sample_list_generator(eval_reader, place)
eval_loader.set_sample_list_generator(eval_reader)
extra_keys = ['im_id', 'im_shape', 'gt_bbox'] extra_keys = ['im_id', 'im_shape', 'gt_bbox']
eval_keys, eval_values, eval_cls = parse_fetches(fetches, eval_prog, eval_keys, eval_values, eval_cls = parse_fetches(fetches, eval_prog,
extra_keys) extra_keys)
...@@ -324,8 +325,8 @@ def main(): ...@@ -324,8 +325,8 @@ def main():
exec_strategy=exec_strategy) exec_strategy=exec_strategy)
if FLAGS.eval: if FLAGS.eval:
compiled_eval_prog = fluid.CompiledProgram(eval_prog) compiled_eval_prog = fluid.CompiledProgram(eval_prog)
# When iterable mode, set set_sample_list_generator(train_reader, place)
train_loader.set_sample_list_generator(train_reader, place) train_loader.set_sample_list_generator(train_reader)
train_stats = TrainingStats(cfg.log_smooth_window, train_keys) train_stats = TrainingStats(cfg.log_smooth_window, train_keys)
train_loader.start() train_loader.start()
......
...@@ -78,7 +78,8 @@ def main(): ...@@ -78,7 +78,8 @@ def main():
exe.run(startup_prog) exe.run(startup_prog)
reader = create_reader(cfg.EvalReader) reader = create_reader(cfg.EvalReader)
loader.set_sample_list_generator(reader, place) # When iterable mode, set set_sample_list_generator(reader, place)
loader.set_sample_list_generator(reader)
dataset = cfg['EvalReader']['dataset'] dataset = cfg['EvalReader']['dataset']
......
...@@ -147,7 +147,8 @@ def main(): ...@@ -147,7 +147,8 @@ def main():
logger.info("pruned FLOPS: {}".format( logger.info("pruned FLOPS: {}".format(
float(base_flops - pruned_flops) / base_flops)) float(base_flops - pruned_flops) / base_flops))
reader = create_reader(cfg.TestReader, devices_num=1) reader = create_reader(cfg.TestReader, devices_num=1)
loader.set_sample_list_generator(reader, place) # When iterable mode, set set_sample_list_generator(reader, place)
loader.set_sample_list_generator(reader)
exe.run(startup_prog) exe.run(startup_prog)
if cfg.weights: if cfg.weights:
......
...@@ -132,7 +132,8 @@ def main(): ...@@ -132,7 +132,8 @@ def main():
eval_prog = eval_prog.clone(True) eval_prog = eval_prog.clone(True)
eval_reader = create_reader(cfg.EvalReader) eval_reader = create_reader(cfg.EvalReader)
eval_loader.set_sample_list_generator(eval_reader, place) # When iterable mode, set set_sample_list_generator(eval_reader, place)
eval_loader.set_sample_list_generator(eval_reader)
# parse eval fetches # parse eval fetches
extra_keys = [] extra_keys = []
......
...@@ -73,7 +73,8 @@ def main(): ...@@ -73,7 +73,8 @@ def main():
eval_prog = eval_prog.clone(True) eval_prog = eval_prog.clone(True)
reader = create_reader(cfg.EvalReader) reader = create_reader(cfg.EvalReader)
loader.set_sample_list_generator(reader, place) # When iterable mode, set set_sample_list_generator(reader, place)
loader.set_sample_list_generator(reader)
# eval already exists json file # eval already exists json file
if FLAGS.json_eval: if FLAGS.json_eval:
......
...@@ -75,7 +75,8 @@ def main(): ...@@ -75,7 +75,8 @@ def main():
infer_prog = infer_prog.clone(True) infer_prog = infer_prog.clone(True)
reader = create_reader(cfg.TestReader) reader = create_reader(cfg.TestReader)
loader.set_sample_list_generator(reader, place) # When iterable mode, set set_sample_list_generator(reader, place)
loader.set_sample_list_generator(reader)
not_quant_pattern = [] not_quant_pattern = []
if FLAGS.not_quant_pattern: if FLAGS.not_quant_pattern:
not_quant_pattern = FLAGS.not_quant_pattern not_quant_pattern = FLAGS.not_quant_pattern
......
...@@ -129,7 +129,8 @@ def main(): ...@@ -129,7 +129,8 @@ def main():
eval_prog = eval_prog.clone(True) eval_prog = eval_prog.clone(True)
eval_reader = create_reader(cfg.EvalReader) eval_reader = create_reader(cfg.EvalReader)
eval_loader.set_sample_list_generator(eval_reader, place) # When iterable mode, set set_sample_list_generator(eval_reader, place)
eval_loader.set_sample_list_generator(eval_reader)
# parse eval fetches # parse eval fetches
extra_keys = [] extra_keys = []
...@@ -210,7 +211,8 @@ def main(): ...@@ -210,7 +211,8 @@ def main():
train_reader = create_reader(cfg.TrainReader, train_reader = create_reader(cfg.TrainReader,
(cfg.max_iters - start_iter) * devices_num) (cfg.max_iters - start_iter) * devices_num)
train_loader.set_sample_list_generator(train_reader, place) # When iterable mode, set set_sample_list_generator(train_reader, place)
train_loader.set_sample_list_generator(train_reader)
# whether output bbox is normalized in model output layer # whether output bbox is normalized in model output layer
is_bbox_normalized = False is_bbox_normalized = False
......
...@@ -84,7 +84,8 @@ def main(): ...@@ -84,7 +84,8 @@ def main():
return return
eval_reader = create_reader(cfg.EvalReader) eval_reader = create_reader(cfg.EvalReader)
eval_loader.set_sample_list_generator(eval_reader, place) # When iterable mode, set set_sample_list_generator(eval_reader, place)
eval_loader.set_sample_list_generator(eval_reader)
# parse eval fetches # parse eval fetches
extra_keys = [] extra_keys = []
......
...@@ -74,7 +74,8 @@ def main(): ...@@ -74,7 +74,8 @@ def main():
eval_prog = eval_prog.clone(True) eval_prog = eval_prog.clone(True)
reader = create_reader(cfg.EvalReader, devices_num=1) reader = create_reader(cfg.EvalReader, devices_num=1)
loader.set_sample_list_generator(reader, place) # When iterable mode, set set_sample_list_generator(reader, place)
loader.set_sample_list_generator(reader)
dataset = cfg['EvalReader']['dataset'] dataset = cfg['EvalReader']['dataset']
......
...@@ -120,7 +120,8 @@ def main(): ...@@ -120,7 +120,8 @@ def main():
infer_prog = infer_prog.clone(True) infer_prog = infer_prog.clone(True)
reader = create_reader(cfg.TestReader, devices_num=1) reader = create_reader(cfg.TestReader, devices_num=1)
loader.set_sample_list_generator(reader, place) # When iterable mode, set set_sample_list_generator(reader, place)
loader.set_sample_list_generator(reader)
exe.run(startup_prog) exe.run(startup_prog)
if cfg.weights: if cfg.weights:
......
...@@ -146,7 +146,8 @@ def main(): ...@@ -146,7 +146,8 @@ def main():
eval_prog = eval_prog.clone(True) eval_prog = eval_prog.clone(True)
eval_reader = create_reader(cfg.EvalReader, devices_num=1) eval_reader = create_reader(cfg.EvalReader, devices_num=1)
eval_loader.set_sample_list_generator(eval_reader, place) # When iterable mode, set set_sample_list_generator(eval_reader, place)
eval_loader.set_sample_list_generator(eval_reader)
# parse eval fetches # parse eval fetches
extra_keys = [] extra_keys = []
...@@ -206,7 +207,8 @@ def main(): ...@@ -206,7 +207,8 @@ def main():
cfg, cfg,
devices_num=devices_num, devices_num=devices_num,
num_trainers=num_trainers) num_trainers=num_trainers)
train_loader.set_sample_list_generator(train_reader, place) # When iterable mode, set set_sample_list_generator(train_reader, place)
train_loader.set_sample_list_generator(train_reader)
# whether output bbox is normalized in model output layer # whether output bbox is normalized in model output layer
is_bbox_normalized = False is_bbox_normalized = False
......
...@@ -162,7 +162,8 @@ def main(): ...@@ -162,7 +162,8 @@ def main():
eval_prog = eval_prog.clone(True) eval_prog = eval_prog.clone(True)
eval_reader = create_reader(cfg.EvalReader, devices_num=1) eval_reader = create_reader(cfg.EvalReader, devices_num=1)
eval_loader.set_sample_list_generator(eval_reader, place) # When iterable mode, set set_sample_list_generator(eval_reader, place)
eval_loader.set_sample_list_generator(eval_reader)
# parse eval fetches # parse eval fetches
extra_keys = [] extra_keys = []
...@@ -200,7 +201,8 @@ def main(): ...@@ -200,7 +201,8 @@ def main():
cfg.TrainReader, (cfg.max_iters - start_iter) * devices_num, cfg.TrainReader, (cfg.max_iters - start_iter) * devices_num,
cfg, cfg,
devices_num=devices_num) devices_num=devices_num)
train_loader.set_sample_list_generator(train_reader, place) # When iterable mode, set set_sample_list_generator(train_reader, place)
train_loader.set_sample_list_generator(train_reader)
# whether output bbox is normalized in model output layer # whether output bbox is normalized in model output layer
is_bbox_normalized = False is_bbox_normalized = False
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册