| 12 | |
| 13 | |
| 14 | def parse_args(): |
| 15 | parser = argparse.ArgumentParser(description="Train a model") |
| 16 | parser.add_argument("config", help="train config file path") |
| 17 | parser.add_argument("--work_dir", help="the dir to save logs and models") |
| 18 | parser.add_argument("--checkpoint", type=str, |
| 19 | help="the path to checkpoints") |
| 20 | parser.add_argument( |
| 21 | "--gpu", |
| 22 | type=str, |
| 23 | default=None, |
| 24 | help="Number of gpus to use" |
| 25 | ) |
| 26 | parser.add_argument( |
| 27 | "--with_loss", help="show the test loss", action="store_true") |
| 28 | args = parser.parse_args() |
| 29 | return args |
| 30 | |
| 31 | |
| 32 | if __name__ == "__main__": |