diff --git a/keras_applications/mobilenet.py b/keras_applications/mobilenet.py index 7941173..6492957 100644 --- a/keras_applications/mobilenet.py +++ b/keras_applications/mobilenet.py @@ -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) diff --git a/keras_applications/mobilenet_v2.py b/keras_applications/mobilenet_v2.py index ba367e8..56709fb 100644 --- a/keras_applications/mobilenet_v2.py +++ b/keras_applications/mobilenet_v2.py @@ -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)