| 83 | |
| 84 | @logger.catch |
| 85 | def main(exp, args): |
| 86 | if exp.seed is not None: |
| 87 | random.seed(exp.seed) |
| 88 | torch.manual_seed(exp.seed) |
| 89 | cudnn.deterministic = True |
| 90 | warnings.warn( |
| 91 | "You have chosen to seed training. This will turn on the CUDNN deterministic setting, " |
| 92 | "which can slow down your training considerably! You may see unexpected behavior " |
| 93 | "when restarting from checkpoints." |
| 94 | ) |
| 95 | |
| 96 | # set environment variables for distributed training |
| 97 | cudnn.benchmark = True |
| 98 | |
| 99 | trainer = Trainer(exp, args) |
| 100 | trainer.train() |
| 101 | |
| 102 | |
| 103 | if __name__ == "__main__": |