-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtrain.py
More file actions
18 lines (14 loc) · 825 Bytes
/
train.py
File metadata and controls
18 lines (14 loc) · 825 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from utils.Config import ParseTrainConfig, parse_eval
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter
)
parser.add_argument("-c", "--config", help="Path to config file", required=True, type=str)
parser.add_argument("--its", help="Number of optimization steps", required=False, type=int, default=int(1e10))
parser.add_argument("-t", "--time", help="Training time in minutes", required=False, default=180, type=bool)
parser.add_argument("--tqdm", help="Adds progress bar for training", required=False, default=True, type=bool)
args = parser.parse_args()
trainer = ParseTrainConfig(args.config)
# Lowest of both 'args.its, args.time' will be used
trainer.train(args.its, args.tqdm, args.time)