-
Notifications
You must be signed in to change notification settings - Fork 19
/
test.py
34 lines (27 loc) · 1.15 KB
/
test.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
33
34
import argparse
import os
# Must be set before importing torch.
os.environ['CUDA_DEVICE_ORDER'] = 'PCI_BUS_ID'
from config.utils import getTestConfigs
#from utils import Tester
from utils.testing import Tester
def main():
parser = argparse.ArgumentParser(description='Test the SNN model')
parser.add_argument('--datadir',
default=os.path.join(os.getcwd(), 'data'),
help='Data directory')
parser.add_argument('--logdir',
default=os.path.join(os.getcwd(), 'logs/test'),
help='Test logging directory')
parser.add_argument('--config',
default=os.path.join(os.getcwd(), 'test_config.yaml'),
help='Path to test config file')
parser.add_argument('--write',
action='store_true',
help='Write network predictions to logging sub-directory')
args = parser.parse_args()
configs = getTestConfigs(args.logdir, args.config)
tester = Tester(args.datadir, args.write, configs['log'], configs['general'])
tester.test()
if __name__ == '__main__':
main()