From 09b9fbad878913e62a4f3b5cd10e8b7ce6f58f93 Mon Sep 17 00:00:00 2001 From: sjjsmuel Date: Wed, 6 May 2020 14:42:11 +0200 Subject: [PATCH] test GAP instead of flatten the network becomes to large --- network/VGG_16.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network/VGG_16.py b/network/VGG_16.py index f10758e..0fbbd1a 100644 --- a/network/VGG_16.py +++ b/network/VGG_16.py @@ -31,7 +31,7 @@ class VGG_16(NetworkBase): if shouldSave: base_model.save('input/vgg_base_model.h5') - x = Flatten()(base_model.output) + x = GlobalAveragePooling2D()(base_model.output) x = Dense(4096, activation='relu')(x) x = Dense(4096, activation='relu')(x) out = Dense(self.NUM_CLASSES, activation='softmax', name='probs')(x) -- GitLab