-
Notifications
You must be signed in to change notification settings - Fork 0
/
inference_challenge.py
32 lines (26 loc) · 949 Bytes
/
inference_challenge.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 os
import sys
from os.path import dirname, abspath, join, basename, expanduser, normpath
root_dir = dirname((abspath(__file__)))
sys.path.append(root_dir)
from parseit import parse_input
from parseit import Dict2Obj
# from instantiator import get_optimizer_for_params
import dllogger as DLLogger
from tools import fmsg
from tools import plot_tracker
from tools import state_dict_to_cpu
from tools import state_dict_to_gpu
from tools import MyDataParallel
from reproducibility import set_seed
from experiment import Experiment
if __name__ == '__main__':
# default_config_file = join(root_dir, "config_file.json")
args, mode, eval_config = parse_input()
args = Dict2Obj(args)
exp = Experiment(args)
exp.prepare()
path_model = join(eval_config['fd_exp'], 'best-models',
eval_config['case_best_model'], 'model.pt')
assert os.path.isfile(path_model), path_model
exp.run_eval(path_model)