|
a |
|
b/utils/Config.py |
|
|
1 |
""" |
|
|
2 |
Common utility functions and classes |
|
|
3 |
""" |
|
|
4 |
import torch |
|
|
5 |
|
|
|
6 |
class Option(): |
|
|
7 |
"""Training Configuration """ |
|
|
8 |
name = "Lung-Segmentation" |
|
|
9 |
# root dir of training and validation set |
|
|
10 |
root_dir = '/media/storage/wu1114/RSNA/rsna-unet/' |
|
|
11 |
|
|
|
12 |
test_root = '/media/storage/wu1114/RSNA/stage_1_test' |
|
|
13 |
|
|
|
14 |
result_root = '/media/storage/wu1114/RSNA/rsna-unet/test_result/' |
|
|
15 |
|
|
|
16 |
img_size = 512 |
|
|
17 |
num_workers = 1 # number of threads for data loading |
|
|
18 |
shuffle = False # shuffle the data set |
|
|
19 |
batch_size = 8 # GTX1060 3G Memory |
|
|
20 |
epochs = 150 # number of epochs to train |
|
|
21 |
plot_every = 5 # vis every N batches |
|
|
22 |
is_train = True # True for training, False for making prediction |
|
|
23 |
save_model = True # True for saving the model, False for not saving the model |
|
|
24 |
caffe_pretrain = False |
|
|
25 |
env = 'RSNA-UNet' |
|
|
26 |
|
|
|
27 |
n_gpu = 2 # number of GPUs |
|
|
28 |
|
|
|
29 |
learning_rate = 1e-3 # learning rage |
|
|
30 |
weight_decay = 1e-4 # weight decay |
|
|
31 |
|
|
|
32 |
pin_memory = True # use pinned (page-locked) memory. when using CUDA, set to True |
|
|
33 |
|
|
|
34 |
is_cuda = torch.cuda.is_available() # True --> GPU |
|
|
35 |
num_gpus = torch.cuda.device_count() # number of GPUs |
|
|
36 |
checkpoint_dir = "./checkpoints" # dir to save checkpoints |
|
|
37 |
dtype = torch.cuda.FloatTensor if is_cuda else torch.Tensor # data type |
|
|
38 |
|
|
|
39 |
opt = Option() |