Python nets.resnet_v2.resnet_v2_50() Examples

The following are 1 code examples of nets.resnet_v2.resnet_v2_50(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module nets.resnet_v2 , or try the search function .
Example #1
Source File: resnet_v2_50.py    From vehicle-triplet-reid with MIT License 5 votes vote down vote up
def endpoints(image, is_training):
    if image.get_shape().ndims != 4:
        raise ValueError('Input must be of size [batch, height, width, 3]')

    image = image - tf.constant(_RGB_MEAN, dtype=tf.float32, shape=(1,1,1,3))

    with tf.contrib.slim.arg_scope(resnet_arg_scope(batch_norm_decay=0.9, weight_decay=0.0)):
        _, endpoints = resnet_v2_50(image, num_classes=None, is_training=is_training, global_pool=True)

    endpoints['model_output'] = endpoints['global_pool'] = tf.reduce_mean(
        endpoints['resnet_v2_50/block4'], [1, 2], name='pool5', keep_dims=False)

    return endpoints, 'resnet_v2_50'