Main function to spawn the train and test process.
()
| 13 | |
| 14 | |
| 15 | def main(): |
| 16 | """ |
| 17 | Main function to spawn the train and test process. |
| 18 | """ |
| 19 | args = parse_args() |
| 20 | cfg = load_config(args) |
| 21 | cfg = assert_and_infer_cfg(cfg) |
| 22 | |
| 23 | # Perform training. |
| 24 | if cfg.TRAIN.ENABLE: |
| 25 | launch_job(cfg=cfg, init_method=args.init_method, func=train) |
| 26 | |
| 27 | # Perform multi-clip testing. |
| 28 | if cfg.TEST.ENABLE: |
| 29 | launch_job(cfg=cfg, init_method=args.init_method, func=test) |
| 30 | |
| 31 | # Perform model visualization. |
| 32 | if cfg.TENSORBOARD.ENABLE and ( |
| 33 | cfg.TENSORBOARD.MODEL_VIS.ENABLE |
| 34 | or cfg.TENSORBOARD.WRONG_PRED_VIS.ENABLE |
| 35 | ): |
| 36 | launch_job(cfg=cfg, init_method=args.init_method, func=visualize) |
| 37 | |
| 38 | # Run demo. |
| 39 | # if cfg.DEMO.ENABLE: |
| 40 | # demo(cfg) |
| 41 | |
| 42 | |
| 43 | if __name__ == "__main__": |
no test coverage detected