-
Notifications
You must be signed in to change notification settings - Fork 32
/
main.py
25 lines (20 loc) · 729 Bytes
/
main.py
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
import json
import argparse
from trainer import train
def main():
args = setup_parser().parse_args()
param = load_json(args.config)
args = vars(args) # Converting argparse Namespace to a dict.
args.update(param) # Add parameters from json
train(args)
def load_json(setting_path):
with open(setting_path) as data_file:
param = json.load(data_file)
return param
def setup_parser():
parser = argparse.ArgumentParser(description='Reproduce of multiple pre-trained incremental learning algorthms.')
parser.add_argument('--config', type=str, default='./exps/simplecil.json',
help='Json file of settings.')
return parser
if __name__ == '__main__':
main()