-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathtrainval.py
32 lines (25 loc) · 1.05 KB
/
trainval.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 argparse
from utils.config import get_exp_config, print_arguments
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--cfg', default="./config/config.json", type=str, help="Config file path.")
parser.add_argument('--dataset', default="eth", type=str, help="Dataset name.", choices=["eth", "hotel", "univ", "zara1", "zara2"])
parser.add_argument('--tag', default="LMTraj", type=str, help="Personal tag for the model.")
parser.add_argument('--test', default=False, action='store_true', help="Evaluation mode.")
args = parser.parse_args()
print("===== Arguments =====")
print_arguments(vars(args))
print("===== Configs =====")
cfg = get_exp_config(args.cfg)
print_arguments(cfg)
# Update configs
cfg.dataset_name = args.dataset
cfg.checkpoint_name = args.tag
if not args.test:
# Training phase
from model.trainval_accelerator import *
trainval(cfg)
else:
# Evaluation phase
from model.eval_accelerator import *
test(cfg)