Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added an error message for undefined shape on NASNet. #9891

Merged
merged 3 commits into from
Apr 14, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions keras/applications/nasnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,15 @@ def NASNet(input_shape=None,
raise ValueError('If using `weights` as ImageNet with `include_top` '
'as true, `classes` should be 1000')

if (isinstance(input_shape, tuple) and
None in input_shape and
weights == 'imagenet'):
raise ValueError('When specifying the input shape of a NASNet'
' and loading `ImageNet` weights, '
'the input_shape argument must be static '
'(no None entries). Got: `input_shape='
+ str(input_shape) + '`.')

if default_size is None:
default_size = 331

Expand Down