Audit and update vgg16.py error messages
@@ -113,14 +113,17 @@ def VGG16(
A `keras.Model` instance.
"""
if not (weights in {'imagenet', None} or tf.io.gfile.exists(weights)):
- raise ValueError('The `weights` argument should be either '
+ raise ValueError(
+ 'The `weights` argument should be either '
'`None` (random initialization), `imagenet` '
'(pre-training on ImageNet), '
- 'or the path to the weights file to be loaded.')
+ 'or the path to the weights file to be loaded. Received: '
+ f'weights={weights}')
if weights == 'imagenet' and include_top and classes != 1000:
raise ValueError('If using `weights` as `"imagenet"` with `include_top` '
- ' as true, `classes` should be 1000')
+ 'as true, `classes` should be 1000. '
+ f'Received `classes={classes}`')
# Determine proper input shape
input_shape = imagenet_utils.obtain_input_shape(
input_shape,
