-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.py
32 lines (27 loc) · 888 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
26
27
28
29
30
31
32
import json
import os
import argparse
from trainer import SSIAT_train
def main():
args = parse_arguments()
config = load_json(args.config)
merged_config = merge_configs(args, config)
SSIAT_train(merged_config)
def parse_arguments():
parser = argparse.ArgumentParser(description='Reproduce of multiple continual learning algorthms.')
"""
Please specify the corresponding JSON file!!!!
"""
parser.add_argument('--config', type=str, default='./exps/adapter_imageneta.json',
help='Json file of settings.')
return parser.parse_args()
def load_json(settings_path):
with open(settings_path) as data_file:
param = json.load(data_file)
return param
def merge_configs(args, config):
merged_config = vars(args)
merged_config.update(config)
return merged_config
if __name__ == '__main__':
main()