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

clean useless log in DataLoader

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