Closed weiji14 closed 6 years ago
Thank you for reporting the issue, @weiji14. There is no problem in the current implementations, but the docstrings need to be revised, as you pointed out. The include_top=False, pooling=None
arguments should return the last convolutional "block" rather than "layer". The "block" means generally a set of layers, and the "convolutional block" in the ImageNet models typically consists of several convolutional layers followed by (or following) a 2x down-sampling layer.
Thus, it is true that the last output in VGG(include_top=False, pooling=None)
is MaxPooling2D
(block5_pool
). I will revise the docstrings. Thank you!
Thanks for the quick fix. I'll close the issue now :smile:
Loading a VGG19 layer with include_top=False and pooling=None should return an output that is the 4D tensor of the last convolutional layer according to the docstring.
However, we get a MaxPooling layer at the very end rather than a Conv2D layer.
I've traced it back via this git blame to this commit which was a part of https://github.com/farizrahman4u/keras/pull/9
Depending on what is the intended behaviour, we'll need to either change the docstring to clarify that it is the MaxPooling2D layer that is the output, or modify the VGG scripts so that the output is a Conv2D layer.
Some steps involved for the latter (more involved) fix:
if include_top
statement, see this codeblock section.I can create a pull request to help out with the first two once we clarify the intended behaviour. Changing the weight files will require a bit of help.