diff --git a/main.py b/main.py index 5a5754b..1fb0f42 100644 --- a/main.py +++ b/main.py @@ -84,18 +84,22 @@ def layers(vgg_layer3_out, vgg_layer4_out, vgg_layer7_out, is_training, num_clas vgg_layer4_out = tf.multiply(vgg_layer4_out, 0.01) new_layer7_1x1_out = tf.layers.conv2d(vgg_layer7_out, filters=num_classes, kernel_size=(1, 1), strides=(1, 1), - name='new_layer7_1x1_out', kernel_initializer=tf.truncated_normal_initializer(stddev=0.01)) + name='new_layer7_1x1_out', + kernel_initializer=tf.truncated_normal_initializer(stddev=0.01), + activation='relu') new_layer7_1x1_upsampled = tf.layers.conv2d_transpose(new_layer7_1x1_out, filters=num_classes, kernel_size=(3, 3), strides=(2, 2), name='new_layer7_1x1_out_upsampled', padding='same', - kernel_initializer=tf.truncated_normal_initializer(stddev=0.01)) + kernel_initializer=tf.truncated_normal_initializer(stddev=0.01), + activation='relu') new_layer7_1x1_upsampled_bn = tf.layers.batch_normalization(new_layer7_1x1_upsampled, name="new_layer7_1x1_upsampled_bn", training=is_training) new_layer4_1x1_out = tf.layers.conv2d(vgg_layer4_out, filters=num_classes, kernel_size=(1, 1), strides=(1, 1), - name="new_layer4_1x1_out", kernel_initializer=tf.truncated_normal_initializer(stddev=0.01)) + name="new_layer4_1x1_out", activation='relu', + kernel_initializer=tf.truncated_normal_initializer(stddev=0.01)) new_layer4_1x1_out_bn = tf.layers.batch_normalization(new_layer4_1x1_out, name="new_layer4_1x1_out_bn", @@ -104,15 +108,17 @@ def layers(vgg_layer3_out, vgg_layer4_out, vgg_layer7_out, is_training, num_clas new_layer_4_7_combined = tf.add(new_layer7_1x1_upsampled_bn, new_layer4_1x1_out_bn, name="new_layer_4_7_combined") new_layer47_upsampled = tf.layers.conv2d_transpose(new_layer_4_7_combined, filters=num_classes, kernel_size=(3, 3), - strides=(2, 2), name="new_layer47_upsampled", padding='same', - kernel_initializer=tf.truncated_normal_initializer(stddev=0.01)) + strides=(2, 2), name="new_layer47_upsampled", padding='same', + kernel_initializer=tf.truncated_normal_initializer(stddev=0.01), + activation='relu') new_layer47_upsampled_bn = tf.layers.batch_normalization(new_layer47_upsampled, name="new_layer47_upsampled_bn", training = is_training) new_layer3_1x1_out = tf.layers.conv2d(vgg_layer3_out, filters=num_classes, kernel_size=(1, 1), strides=(1, 1), - name="new_layer3_1x1_out", kernel_initializer=tf.truncated_normal_initializer(stddev=0.01)) + name="new_layer3_1x1_out", kernel_initializer=tf.truncated_normal_initializer(stddev=0.01), + activation='relu') new_layer3_1x1_out_bn = tf.layers.batch_normalization(new_layer3_1x1_out, name="new_layer3_1x1_upsampled_bn", training = is_training) @@ -121,7 +127,8 @@ def layers(vgg_layer3_out, vgg_layer4_out, vgg_layer7_out, is_training, num_clas new_final_layer_upsampled_4x = tf.layers.conv2d_transpose(out, filters=num_classes, kernel_size=(4, 4), strides=(4, 4), name="new_final_layer_upsampled_4x", - kernel_initializer=tf.truncated_normal_initializer(stddev=0.01)) + kernel_initializer=tf.truncated_normal_initializer(stddev=0.01), + activation='relu') new_final_layer_upsampled_4x_bn = tf.layers.batch_normalization(new_final_layer_upsampled_4x, name="new_final_layer_upsampled_4x_bn",