Skip to content

Commit

Permalink
Fix warning in _obtain_input_shape (keras-team#7641)
Browse files Browse the repository at this point in the history
  • Loading branch information
avn3r authored and fchollet committed Aug 14, 2017
1 parent 71bfb00 commit 3f9c0a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions keras/applications/imagenet_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@ def _obtain_input_shape(input_shape,
"""
if weights != 'imagenet' and input_shape is not None and len(input_shape) == 3:
if data_format == 'channels_first':
if input_shape[0] != 3 or input_shape[0] != 1:
if input_shape[0] != 3 and input_shape[0] != 1:
warnings.warn(
'This model usually expects 1 or 3 input channels. '
'However, it was passed ' + str(input_shape[0]) + ' input channels.')
default_shape = (input_shape[0], default_size, default_size)
else:
if input_shape[-1] != 3 or input_shape[-1] != 1:
if input_shape[-1] != 3 and input_shape[-1] != 1:
warnings.warn(
'This model usually expects 1 or 3 input channels. '
'However, it was passed ' + str(input_shape[-1]) + ' input channels.')
Expand Down

0 comments on commit 3f9c0a3

Please sign in to comment.