(args)
| 138 | |
| 139 | |
| 140 | def run_main(args): |
| 141 | cfg = load_config(args.config) |
| 142 | if args.gpu is not None: |
| 143 | cfg.resource.gpus = range(args.gpu) |
| 144 | if args.cpu is not None: |
| 145 | cfg.resource.cpu_per_gpu = args.cpu |
| 146 | if args.epoch is not None: |
| 147 | cfg.train.num_epoch = args.epoch |
| 148 | |
| 149 | app = gap.Application(cfg.application, **cfg.resource) |
| 150 | if "format" in cfg: |
| 151 | app.set_format(**cfg.format) |
| 152 | app.load(**cfg.graph) |
| 153 | app.build(**cfg.build) |
| 154 | if "load" in cfg: |
| 155 | app.load_model(**cfg.load) |
| 156 | app.train(**cfg.train) |
| 157 | if args.eval and "evaluate" in cfg: |
| 158 | if isinstance(cfg.evaluate, dict): |
| 159 | cfg.evaluate = [cfg.evaluate] |
| 160 | for evaluation in cfg.evaluate: |
| 161 | app.evaluate(**evaluation) |
| 162 | if "save" in cfg: |
| 163 | app.save_model(**cfg.save) |
| 164 | |
| 165 | |
| 166 | def visualize_main(args): |
nothing calls this directly
no test coverage detected