Skip to content
This repository has been archived by the owner on Nov 3, 2022. It is now read-only.

Commit

Permalink
Custom image size in Mobilenets v1 and v2 (#101)
Browse files Browse the repository at this point in the history
* Size 224 is used for custom sizes in MobileNets

* The warning message for undefined input shapes in MobileNets was updated
  • Loading branch information
ezavarygin authored and taehoonlee committed Apr 15, 2019
1 parent 8a1e4d4 commit dda4997
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions keras_applications/mobilenet.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,11 @@ def MobileNet(input_shape=None,
'`0.25`, `0.50`, `0.75` or `1.0` only.')

if rows != cols or rows not in [128, 160, 192, 224]:
if rows is None:
rows = 224
warnings.warn('MobileNet shape is undefined.'
' Weights for input shape '
'(224, 224) will be loaded.')
rows = 224
warnings.warn('`input_shape` is undefined or non-square, '
'or `rows` is not in [128, 160, 192, 224]. '
'Weights for input shape (224, 224) will be'
' loaded as the default.')

if input_tensor is None:
img_input = layers.Input(shape=input_shape)
Expand Down
10 changes: 5 additions & 5 deletions keras_applications/mobilenet_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,11 +290,11 @@ def MobileNetV2(input_shape=None,
'`1.0`, `1.3` or `1.4` only.')

if rows != cols or rows not in [96, 128, 160, 192, 224]:
if rows is None:
rows = 224
warnings.warn('MobileNet shape is undefined.'
' Weights for input shape'
'(224, 224) will be loaded.')
rows = 224
warnings.warn('`input_shape` is undefined or non-square, '
'or `rows` is not in [96, 128, 160, 192, 224].'
' Weights for input shape (224, 224) will be'
' loaded as the default.')

if input_tensor is None:
img_input = layers.Input(shape=input_shape)
Expand Down

0 comments on commit dda4997

Please sign in to comment.