GeezerVison is showing github.com — Changes to help unet run · stjordanis/DeepLearningTutorials@e0d53ba
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: code/unet/Unet_lasagne_recipes.py +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 12 | 12 | # end-snippet-1 | 13 | 13 |
| 14 | 14 | # start-snippet-downsampling | 15 | | -def build_UNet(n_input_channels=1, BATCH_SIZE=None, num_output_classes=2, pad='same', nonlinearity=lasagne.nonlinearities.elu, input_dim=(128, 128), base_n_filters=64, do_dropout=False): | | 15 | +def build_UNet(n_input_channels=1, BATCH_SIZE=None, num_output_classes=2, pad='same', nonlinearity=lasagne.nonlinearities.elu, input_dim=(None, None), base_n_filters=64, do_dropout=False): | 16 | 16 | net = OrderedDict() | 17 | 17 | net['input'] = InputLayer((BATCH_SIZE, n_input_channels, input_dim[0], input_dim[1])) | 18 | 18 |
| |
Collapse file Copy file name to clipboardExpand all lines: code/unet/train_unet.py +5-3Lines changed: 5 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -207,7 +207,7 @@ def train(dataset, learn_step=0.005, | 207 | 207 |
| 208 | 208 | net = build_UNet(n_input_channels= nb_in_channels,# BATCH_SIZE = batch_size, | 209 | 209 | num_output_classes = n_classes, base_n_filters = 64, do_dropout=False, | 210 | | - input_dim =input_dim) | | 210 | + input_dim = (None, None)) | 211 | 211 |
| 212 | 212 | output_layer = net["output_flattened"] | 213 | 213 | # | @@ -383,7 +383,8 @@ def main(): | 383 | 383 | help='Max patience') | 384 | 384 | parser.add_argument('-batch_size', | 385 | 385 | type=int, | 386 | | - default=[10, 1, 1], | | 386 | + nargs='+', | | 387 | + default=[5, 1, 1], | 387 | 388 | help='Batch size [train, val, test]') | 388 | 389 | parser.add_argument('-data_augmentation', | 389 | 390 | type=dict, | @@ -394,7 +395,8 @@ def main(): | 394 | 395 | 'fill_mode':'reflect', | 395 | 396 | 'spline_warp':True, | 396 | 397 | 'warp_sigma':10, | 397 | | - 'warp_grid_size':3}, | | 398 | + 'warp_grid_size':3, | | 399 | + 'crop_size': (224, 224)}, | 398 | 400 | help='use data augmentation') | 399 | 401 | parser.add_argument('-early_stop_class', | 400 | 402 | type=int, | |
|