(
        is_training=True, weight_decay=cfgs.WEIGHT_DECAY, batch_norm_decay=0.997,
        batch_norm_epsilon=1e-5, batch_norm_scale=True)
In Default, we do not use BN to train resnet, since batch_size is too small.
    So is_training is False and trainable is False in the batch_norm params.
def resnet_arg_scope(
        is_training=True, weight_decay=cfgs.WEIGHT_DECAY, batch_norm_decay=0.997,
        batch_norm_epsilon=1e-5, batch_norm_scale=True):
    '''

    In Default, we do not use BN to train resnet, since batch_size is too small.
    So is_training is False and trainable is False in the batch_norm params.

    '''
    batch_norm_params = {
        'is_training': False, 'decay': batch_norm_decay,
        'epsilon': batch_norm_epsilon, 'scale': batch_norm_scale,
        'trainable': False,
        'updates_collections': tf.GraphKeys.UPDATE_OPS
    }

    with slim.arg_scope(
            [slim.conv2d],
            weights_regularizer=slim.l2_regularizer(weight_decay),
            weights_initializer=slim.variance_scaling_initializer(),
            trainable=is_training,
            activation_fn=tf.nn.relu,
            normalizer_fn=slim.batch_norm,
            normalizer_params=batch_norm_params):
        with slim.arg_scope([slim.batch_norm], **batch_norm_params) as arg_sc:
            return arg_sc
def resnet_arg_scope ( is_training = True , weight_decay = cfgs . WEIGHT_DECAY , batch_norm_decay = 0.997 , batch_norm_epsilon = 1e-5 , batch_norm_scale = True ) : batch_norm_params = { 'is_training' : False , 'decay' : batch_norm_decay , 'epsilon' : batch_norm_epsilon , 'scale' : batch_norm_scale , 'trainable' : False , 'updates_collections' : tf . GraphKeys . UPDATE_OPS } with slim . arg_scope ( [ slim . conv2d ] , weights_regularizer = slim . l2_regularizer ( weight_decay ) , weights_initializer = slim . variance_scaling_initializer ( ) , trainable = is_training , activation_fn = tf . nn . relu , normalizer_fn = slim . batch_norm , normalizer_params = batch_norm_params ) : with slim . arg_scope ( [ slim . batch_norm ] , * * batch_norm_params ) as arg_sc : return arg_sc