-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtrain.py
More file actions
36 lines (29 loc) · 1.03 KB
/
Copy pathtrain.py
File metadata and controls
36 lines (29 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
@Time : 2019-12-24 22:54
@Author : Wang Xin
@Email : wangxin_buaa@163.com
@File : train.py
"""
import argparse
import logging
import warnings
warnings.filterwarnings("ignore")
logging.basicConfig(format='[%(asctime)s %(levelname)s] %(message)s',
datefmt='%m/%d/%Y %H:%M:%S',
level=logging.INFO)
from ml.solver import Solver
parser = argparse.ArgumentParser(description='Training script')
parser.add_argument('--id', type=str, default='base', help='Id of the training')
parser.add_argument('--mode', type=str, default='train', choices=['pretrain', 'train', 'val', 'resume', 'hyperopt'],
help='The mode of the running.')
parser.add_argument('-c', '--config', type=str, default='config/config_files/kitti_base.yaml', help='Config file name')
args = parser.parse_args()
solver = Solver(args)
if args.mode in ['pretrain', 'train', 'resume']:
print(solver.config)
solver.train()
else:
print(solver.config)
solver.train()