Skip to content

Commit 92ab78d

Browse files
committed
Correct DenseNet implementation
1 parent fd6dc95 commit 92ab78d

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

densenet.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,8 @@ def __dense_block(x, nb_layers, nb_filter, growth_rate, bottleneck=False, dropou
384384
cb = __conv_block(x, growth_rate, bottleneck, dropout_rate, weight_decay)
385385
x_list.append(cb)
386386

387-
# x = concatenate(x_list, axis=concat_axis)
388-
x = concatenate([x, cb], axis=concat_axis)
387+
x = concatenate(x_list, axis=concat_axis)
388+
#x = concatenate([x, cb], axis=concat_axis)
389389

390390
if grow_nb_filters:
391391
nb_filter += growth_rate
@@ -638,6 +638,9 @@ def __create_fcn_dense_net(nb_classes, img_input, include_top, nb_dense_block=5,
638638

639639
if __name__ == '__main__':
640640

641-
model = DenseNet((32, 32, 3), depth=40, growth_rate=12, nb_filter=16)
641+
from keras.utils.vis_utils import plot_model
642+
model = DenseNetFCN((32, 32, 3), growth_rate=16, nb_layers_per_block=5, upsampling_type='deconv')
643+
#model = DenseNet((32, 32, 3))
644+
model.summary()
642645

643-
model.summary()
646+
plot_model(model, 'test.png', show_shapes=True)

0 commit comments

Comments
 (0)