From c94b4a5a293c5112834c8b47fb272a8bcd68e6e3 Mon Sep 17 00:00:00 2001 From: jrwin Date: Fri, 8 Sep 2017 09:12:21 +0800 Subject: [PATCH 1/2] Update densenet.py exclude the input with the feature maps in the concatenation after the last desnblock --- densenet.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/densenet.py b/densenet.py index 60840a0..c4ef5c9 100644 --- a/densenet.py +++ b/densenet.py @@ -767,7 +767,10 @@ def __create_fcn_dense_net(nb_classes, img_input, include_top, nb_dense_block=5, grow_nb_filters=False) if include_top: - x = Conv2D(nb_classes, (1, 1), activation='linear', padding='same', use_bias=False)(x_up) + # not the concatenation of the input with the feature maps concat_list[0] in the decompression path + l = concatenate(concat_list[1:], axis=concat_axis) + x = Conv2D(nb_classes, (1, 1), activation='linear', padding='same', use_bias=False)(l) + #x = Conv2D(nb_classes, (1, 1), activation='linear', padding='same', use_bias=False)(x_up) if K.image_data_format() == 'channels_first': channel, row, col = input_shape @@ -792,4 +795,4 @@ def __create_fcn_dense_net(nb_classes, img_input, include_top, nb_dense_block=5, model = DenseNet((32, 32, 3), weights=None) model.summary() - plot_model(model, 'test.png', show_shapes=True) \ No newline at end of file + plot_model(model, 'test.png', show_shapes=True) From 32d45665feb481888936631bb8e62caba2a09e52 Mon Sep 17 00:00:00 2001 From: jrwin Date: Fri, 8 Sep 2017 09:14:07 +0800 Subject: [PATCH 2/2] Update densenet.py --- densenet.py | 1 - 1 file changed, 1 deletion(-) diff --git a/densenet.py b/densenet.py index c4ef5c9..cfb70fe 100644 --- a/densenet.py +++ b/densenet.py @@ -770,7 +770,6 @@ def __create_fcn_dense_net(nb_classes, img_input, include_top, nb_dense_block=5, # not the concatenation of the input with the feature maps concat_list[0] in the decompression path l = concatenate(concat_list[1:], axis=concat_axis) x = Conv2D(nb_classes, (1, 1), activation='linear', padding='same', use_bias=False)(l) - #x = Conv2D(nb_classes, (1, 1), activation='linear', padding='same', use_bias=False)(x_up) if K.image_data_format() == 'channels_first': channel, row, col = input_shape