forked from AayushKrChaudhary/RITnet
-
Notifications
You must be signed in to change notification settings - Fork 3
/
opt.py
40 lines (31 loc) · 1.74 KB
/
opt.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
35
36
from pprint import pprint
import argparse
def parse_args():
parser = argparse.ArgumentParser()
# Data input settings
parser.add_argument('--dataset', type=str, default='Semantic_Segmentation_Dataset/', help='name of dataset')
# Optimization: General
parser.add_argument('--bs', type=int, default = 8 )
parser.add_argument('--epochs', type=int,help='Number of epochs',default= 250)
parser.add_argument('--workers', type=int,help='Number of workers',default=4)
parser.add_argument('--model', help='model name',default='densenet')
parser.add_argument('--evalsplit', help='eval spolit',default='val')
parser.add_argument('--lr', type=float,default= 1e-3,help='Learning rate')
parser.add_argument('--save', help='save folder name',default='0try')
parser.add_argument('--seed', type=int, default=1111, help='random seed')
parser.add_argument('--load', type=str, default='best_model.pkl', help='load checkpoint file name')
parser.add_argument('--resume', action='store_true', help='resume train from load chkpoint')
parser.add_argument('--test', action='store_true', help='test only')
parser.add_argument('--savemodel',action='store_true',help='checkpoint save the model')
parser.add_argument('--testrun', action='store_true', help='test run with few dataset')
parser.add_argument('--expname', type=str, default='info', help='extra explanation of the method')
parser.add_argument('--useGPU', type=str, default=True, help='Set it as False if GPU is unavailable')
# parse
args = parser.parse_args()
opt = vars(args)
pprint('parsed input parameters:')
pprint(opt)
return args
if __name__ == '__main__':
opt = parse_args()
print('opt[\'dataset\'] is ', opt.dataset)