-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathmain_evaluation.py
More file actions
35 lines (28 loc) · 1017 Bytes
/
main_evaluation.py
File metadata and controls
35 lines (28 loc) · 1017 Bytes
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
# ============================================
__author__ = "Sachin Mehta and Ximing Lu"
__maintainer__ = "Sachin Mehta and Ximing Lu"
# ============================================
from config.opts import get_config
from train_and_eval.evaluator import Evaluator
import torch
from utilities.utils import (
save_arguments,
load_arguments_file
)
import os
from utilities.print_utilities import *
import json
if __name__ == '__main__':
# get argumetns
opts, parser = get_config()
torch.set_default_dtype(torch.float32)
if opts.config_file:
# load arguments fromm config file
if not os.path.isfile(opts.config_file):
print_error_message('Config file does not exists here: {}'.format(opts.config_file))
opts = load_arguments_file(parser=parser, arg_fname=opts.config_file)
print_log_message('Arguments')
print(json.dumps(vars(opts), indent=4, sort_keys=True))
# run the evaluation code
evaluator = Evaluator(opts=opts)
evaluator.run()