-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathtest_runner.py
31 lines (28 loc) · 1.47 KB
/
test_runner.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
from tester import Tester
import argparse
import torch
if __name__ == '__main__':
# Testing settings
parser = argparse.ArgumentParser(description='PyTorch To test Chest-Xray by using densenet')
parser.add_argument('--model', type=str, default='DenseNet',
help='The model name [DenseNet121, DenseNet161, DenseNet169, '
'DenseNet201, CheXNet, ResNet18, ResNet34, ResNet50,'
' ResNet101, ResNet152, VGG191]')
parser.add_argument('--data-dir', type=str, default='../data',
help='the path of the data directory')
parser.add_argument('--test-csv', type=str, default='',
help='the path of the test csv')
parser.add_argument('--weight-dir', type=str, default='',
help='the path of trained model')
parser.add_argument('--batch-size', type=int, default=256,
help='the batch size when testing')
parser.add_argument('--no-cuda', action='store_true', default=False,
help='disables CUDA training')
parser.add_argument('--reshape-size', type=int, default=224,
help='the size of the input image')
parser.add_argument('--classes', type=int, default=156,
help='the #classes of target')
args = parser.parse_args()
args.cuda = not args.no_cuda and torch.cuda.is_available()
tester = Tester(args=args)
tester.test()