-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcfg.py
39 lines (36 loc) · 2.4 KB
/
cfg.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
37
38
39
import argparse
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('-net', type=str, required=True, help='net type')
parser.add_argument('-baseline', type=str, default='unet', help='baseline net type')
parser.add_argument('-seg_net', type=str, default='transunet', help='net type')
parser.add_argument('-mod', type=str, required=True, help='mod type:seg,cls,val_ad')
parser.add_argument('-exp_name', type=str, required=True, help='net type')
parser.add_argument('-type', type=str, default='map', help='condition type:ave,rand,rand_map')
parser.add_argument('-vis', type=bool, default=False, help='visualization')
parser.add_argument('--val_freq',type=int,default=1,help='interval between each validation')
parser.add_argument('-gpu', type=bool, default=True, help='use gpu or not')
parser.add_argument('-gpu_device', type=int, default=0, help='use which gpu')
parser.add_argument('-epoch_ini', type=int, default=1, help='start epoch')
parser.add_argument('-image_size', type=int, default=256, help='image_size')
parser.add_argument('-patch_size', type=int, default=8, help='patch_size')
parser.add_argument('-dim', type=int, default=512, help='dim_size')
parser.add_argument('-depth', type=int, default=1, help='depth')
parser.add_argument('-heads', type=int, default=16, help='heads number')
parser.add_argument('-mlp_dim', type=int, default=1024, help='mlp_dim')
parser.add_argument('-w', type=int, default=4, help='number of workers for dataloader')
parser.add_argument('-b', type=int, default=16, help='batch size for dataloader')
parser.add_argument('-s', type=bool, default=True, help='whether shuffle the dataset')
parser.add_argument('-warm', type=int, default=1, help='warm up training phase')
parser.add_argument('-lr', type=float, default=1e-4, help='initial learning rate')
parser.add_argument('-imp_lr', type=float, default=3e-4, help='implicit learning rate')
parser.add_argument('-weights', type=str, default = 0, help='the weights file you want to test')
parser.add_argument('-base_weights', type=str, default = 0, help='the weights baseline')
parser.add_argument('-distributed', default='0,1,2,3' ,type=str,help='multi GPU ids to use')
parser.add_argument(
'-data_path',
type=str,
default='../dataset',
help='The path of segmentation data')
opt = parser.parse_args()
return opt