| 35 | |
| 36 | |
| 37 | def get_args_parser(add_help: bool = True): |
| 38 | parser = argparse.ArgumentParser("DINOv2 training", add_help=add_help) |
| 39 | parser.add_argument( |
| 40 | "--config-file", |
| 41 | "-c", |
| 42 | "--config", |
| 43 | default="", |
| 44 | metavar="FILE", |
| 45 | help="path to config file", |
| 46 | ) |
| 47 | parser.add_argument( |
| 48 | "--no-resume", |
| 49 | action="store_true", |
| 50 | help="Whether to not attempt to resume from the checkpoint directory. ", |
| 51 | ) |
| 52 | parser.add_argument( |
| 53 | "--eval-only", action="store_true", help="perform evaluation only" |
| 54 | ) |
| 55 | parser.add_argument("--eval", type=str, default="", help="Eval type to perform") |
| 56 | parser.add_argument( |
| 57 | "opts", |
| 58 | help=""" |
| 59 | Modify config options at the end of the command. For Yacs configs, use |
| 60 | space-separated "PATH.KEY VALUE" pairs. |
| 61 | For python-based LazyConfig, use "path.key=value". |
| 62 | """.strip(), |
| 63 | default=None, |
| 64 | nargs=argparse.REMAINDER, |
| 65 | ) |
| 66 | parser.add_argument("--run-name", default="00", help="run name for wandb") |
| 67 | |
| 68 | parser.add_argument("--group-name", default="test", help="group name for wandb") |
| 69 | |
| 70 | return parser |
| 71 | |
| 72 | |
| 73 | def build_optimizer(cfg, params_groups): |