Skip to content

Commit 77559e0

Browse files
committed
set training batch size
1 parent 7aaa572 commit 77559e0

5 files changed

Lines changed: 19 additions & 11 deletions

File tree

segmentation/JSRT/config/train_test.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ train_csv = config/jsrt_train.csv
88
valid_csv = config/jsrt_valid.csv
99
test_csv = config/jsrt_test.csv
1010

11+
train_batch_size = 4
12+
1113
load_pixelwise_weight = False
1214
# modality number
1315
modal_num = 1
@@ -55,7 +57,6 @@ bilinear = False
5557
# list of gpus
5658
gpus = [0]
5759

58-
batch_size = 4
5960
loss_type = DiceLoss
6061
DiceLoss_enable_pixel_weight = False
6162
DiceLoss_enable_class_weight = False
@@ -82,7 +83,6 @@ iter_save = 2000
8283
[testing]
8384
# list of gpus
8485
gpus = [0]
85-
batch_size = 4
8686

8787
# checkpoint mode can be [0-latest, 1-best, 2-specified]
8888
ckpt_mode = 0

segmentation/JSRT/image_convert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def convert_JCRT_labels(input_dir, output_dir):
5757
label.save(output_full_name)
5858

5959
if __name__ == "__main__":
60-
JSRT_root = "data/JSRT"
60+
JSRT_root = "/home/guotai/disk2t/data/JSRT"
6161
input_image_dir = JSRT_root + "/All247images"
6262
output_image_dir = JSRT_root + "/image"
6363
convert_JCRT_images(input_image_dir, output_image_dir)

segmentation/JSRT2/config/train_test.cfg

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ train_csv = ../JSRT/config/jsrt_train.csv
88
valid_csv = ../JSRT/config/jsrt_valid.csv
99
test_csv = ../JSRT/config/jsrt_test.csv
1010

11+
train_batch_size = 4
12+
1113
load_pixelwise_weight = False
1214
# modality number
1315
modal_num = 1
@@ -53,7 +55,7 @@ bilinear = True
5355
[training]
5456
# list of gpus
5557
gpus = [0]
56-
batch_size = 4
58+
5759
loss_type = MyFocalDiceLoss
5860
MyFocalDiceLoss_Enable_Pixel_Weight = False
5961
MyFocalDiceLoss_Enable_Class_Weight = True
@@ -83,7 +85,6 @@ iter_save = 2000
8385
[testing]
8486
# list of gpus
8587
gpus = [0]
86-
batch_size = 4
8788

8889
# checkpoint mode can be [0-latest, 1-best, 2-specified]
8990
ckpt_mode = 0

segmentation/fetal_hc/config/train_test.cfg

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ train_csv = config/fetal_hc_train.csv
88
valid_csv = config/fetal_hc_valid.csv
99
test_csv = config/fetal_hc_test.csv
1010

11+
train_batch_size = 4
12+
1113
load_pixelwise_weight = False
1214
# modality number
1315
modal_num = 1
@@ -63,7 +65,6 @@ bilinear = True
6365
# list of gpus
6466
gpus = [0]
6567

66-
batch_size = 4
6768
loss_type = DiceLoss
6869
DiceLoss_enable_pixel_weight = False
6970
DiceLoss_enable_class_weight = False
@@ -91,9 +92,6 @@ iter_save = 5000
9192
# list of gpus
9293
gpus = [0]
9394

94-
# note that the images have different sizes, batch size for inference should be 1
95-
batch_size = 1
96-
9795
# checkpoint mode can be [0-latest, 1-best, 2-specified]
9896
ckpt_mode = 1
9997
output_dir = result

segmentation/prostate/config/train_test.cfg

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ train_csv = config/data/image_train.csv
88
valid_csv = config/data/image_valid.csv
99
test_csv = config/data/image_test.csv
1010

11+
train_batch_size = 4
12+
1113
load_pixelwise_weight = False
1214
# modality number
1315
modal_num = 1
@@ -60,7 +62,6 @@ trilinear = True
6062
# list of gpus
6163
gpus = [0]
6264

63-
batch_size = 4
6465
loss_type = DiceLoss
6566
DiceLoss_enable_pixel_weight = False
6667
DiceLoss_enable_class_weight = False
@@ -87,11 +88,19 @@ iter_save = 3000
8788
[testing]
8889
# list of gpus
8990
gpus = [0]
90-
batch_size = 1
9191

9292
# checkpoint mode can be [0-latest, 1-best, 2-specified]
9393
ckpt_mode = 0
9494
output_dir = result
9595
evaluation_mode = True
9696
test_time_dropout = False
9797

98+
# use test time augmentation
99+
tta_mode = 1
100+
101+
infer_sliding_window = 1
102+
sliding_window_size = [272, 480]
103+
sliding_window_stride = [272, 480]
104+
105+
106+

0 commit comments

Comments
 (0)