Commit 7910ab16 authored by Peizhao Zhang's avatar Peizhao Zhang Committed by Facebook GitHub Bot
Browse files

Allow skipping do_test after do_train.

Summary:
Pull Request resolved: https://github.com/facebookresearch/d2go/pull/278

Allow skipping do_test after do_train.

Reviewed By: wat3rBro

Differential Revision: D36786790

fbshipit-source-id: 785556b5743ee9af2abfe6c0e9e78c7055697048
parent 2228d3a0
......@@ -123,6 +123,10 @@ def get_base_runner_default_cfg(cfg: CN) -> CN:
# Frequency of metric printer, tensorboard writer, etc.
cfg.WRITER_PERIOD = 20
# train_net specific arguments, define in runner but used in train_net
# run evaluation after training is done
cfg.TEST.FINAL_EVAL = True
return cfg
......
......@@ -81,8 +81,14 @@ def main(
)
trained_cfgs = runner.do_train(cfg, model, resume=resume)
metrics = runner.do_test(cfg, model)
print_metrics_table(metrics)
final_eval = cfg.TEST.FINAL_EVAL
if final_eval:
# run evaluation after training in the same processes
metrics = runner.do_test(cfg, model)
print_metrics_table(metrics)
else:
metrics = {}
# dump config files for trained models
trained_model_configs = dump_trained_model_configs(cfg.OUTPUT_DIR, trained_cfgs)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment