Skip to content

Commit

Permalink
Fix densenet (make behavior follow docstring, and be consistent with …
Browse files Browse the repository at this point in the history
…other applications)
  • Loading branch information
fchollet committed Jan 20, 2018
1 parent 475def3 commit 1a78487
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions keras/applications/densenet.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from ..layers import Conv2D
from ..layers import Dense
from ..layers import GlobalAveragePooling2D
from ..layers import GlobalMaxPooling2D
from ..layers import Input
from ..layers import MaxPooling2D
from ..layers import ZeroPadding2D
Expand Down Expand Up @@ -217,9 +218,9 @@ def DenseNet(blocks,
x = Dense(classes, activation='softmax', name='fc1000')(x)
else:
if pooling == 'avg':
x = AveragePooling2D(7, name='avg_pool')(x)
x = GlobalAveragePooling2D(name='avg_pool')(x)
elif pooling == 'max':
x = MaxPooling2D(7, name='max_pool')(x)
x = GlobalMaxPooling2D(name='max_pool')(x)

# Ensure that the model takes into account
# any potential predecessors of `input_tensor`.
Expand Down

0 comments on commit 1a78487

Please sign in to comment.