|
21 | 21 | add_arg = lambda *args: utility.add_arguments(*args, argparser=parser)
|
22 | 22 |
|
23 | 23 | # yapf: disable
|
24 |
| -add_arg('batch_size', int, 2, "The number of images in each batch during training.") |
| 24 | +add_arg('batch_size', int, 4, "The number of images in each batch during training.") |
25 | 25 | add_arg('train_crop_size', int, 769, "Image crop size during training.")
|
26 |
| -add_arg('base_lr', float, 0.0001, "The base learning rate for model training.") |
27 |
| -add_arg('total_step', int, 90000, "Number of the training step.") |
| 26 | +add_arg('base_lr', float, 0.001, "The base learning rate for model training.") |
| 27 | +add_arg('total_step', int, 500000, "Number of the training step.") |
28 | 28 | add_arg('init_weights_path', str, None, "Path of the initial weights in paddlepaddle format.")
|
29 | 29 | add_arg('save_weights_path', str, None, "Path of the saved weights during training.")
|
30 | 30 | add_arg('dataset_path', str, None, "Cityscape dataset path.")
|
|
39 | 39 | parser.add_argument(
|
40 | 40 | '--enable_ce',
|
41 | 41 | action='store_true',
|
42 |
| - help='If set, run the task with continuous evaluation logs.') |
| 42 | + help='If set, run the task with continuous evaluation logs. Users can ignore this agument.') |
43 | 43 | #yapf: enable
|
44 | 44 |
|
45 | 45 | @contextlib.contextmanager
|
@@ -87,7 +87,8 @@ def loss(logit, label):
|
87 | 87 | label = fluid.layers.reshape(label, [-1, 1])
|
88 | 88 | label = fluid.layers.cast(label, 'int64')
|
89 | 89 | label_nignore = fluid.layers.reshape(label_nignore, [-1, 1])
|
90 |
| - loss = fluid.layers.softmax_with_cross_entropy(logit, label, ignore_index=255, numeric_stable_mode=True) |
| 90 | + logit = fluid.layers.softmax(logit, use_cudnn=False) |
| 91 | + loss = fluid.layers.cross_entropy(logit, label, ignore_index=255) |
91 | 92 | label_nignore.stop_gradient = True
|
92 | 93 | label.stop_gradient = True
|
93 | 94 | return loss, label_nignore
|
|
0 commit comments