This repository has been archived by the owner on Nov 3, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the bottleneck of ResNet50 reported in #5
- Loading branch information
4b18156
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be an invisible breaking change for quite a few user models, including some of mine which will suddenly access something in the last identity block without warning or error... Are you sure about just moving it and committing it to master?
Perhaps consider printing a warning about this change for a few versions in the else case of
if include_top:
?4b18156
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the comment, @ahundt. I think that this commit is better to be called "a correction" rather than "a breaking change". When using
app(weights='imagenet', include_top=False)
, users expect 16x or 32x down-sampled feature maps and all the apps exceptResNet50
return a 32x map (7x7 for a 224x224 input) correctly. The currentResNet50
results in a 224x down-sampled map (1x1) which is apparently weird. Anyway I think the idea printing a warning is good as you pointed out.Please note that the results of
model = ResNet50(weights='imagenet', include_top=False, input_shape=(224, 224, 3)); model.summary()
are:Before this commit:
After this commit:
4b18156
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't quite get it why users would expect 16x or 32x downsampling. The architecture is the author's legacy and it could be anything. What would happen when there is a new competitive architecture and it doesn't follow that number?
I do think that breaking changes should be at least warned or in the release notes
4b18156
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the comments, @akbargumbira.
include_top=False
is designed for feature extraction as described in the official docs. The feature does not have to be always 16x (14x14) or 32x (7x7) down-sampled feature maps. But the 224x down-sampled map (1x1) is apparently weird.