(inputs, num_classes=1001, is_training=True,
                        dropout_keep_prob=0.8,#0.8
                        reuse=None,
                        scope='InceptionResnetV2',
                        create_aux_logits=True)
Creates the Inception Resnet V2 model.

  Args:
    inputs: a 4-D tensor of size [batch_size, height, width, 3].
    num_classes: number of predicted classes.
    is_training: whether is training or not.
    dropout_keep_prob: float, the fraction to keep before final layer.
    reuse: whether or not the network and its variables should be reused. To be
      able to reuse 'scope' must be given.
    scope: Optional variable_scope.
    create_aux_logits: Whether to include the auxilliary logits.

  Returns:
    logits: the logits outputs of the model.
    end_points: the set of end_points from the inception model.
Creates the Inception Resnet V2 model.
Creates the Inception Resnet V2 model .
def inception_resnet_v2(inputs, num_classes=1001, is_training=True,
                        dropout_keep_prob=0.8,#0.8
                        reuse=None,
                        scope='InceptionResnetV2',
                        create_aux_logits=True):
  """Creates the Inception Resnet V2 model.

  Args:
    inputs: a 4-D tensor of size [batch_size, height, width, 3].
    num_classes: number of predicted classes.
    is_training: whether is training or not.
    dropout_keep_prob: float, the fraction to keep before final layer.
    reuse: whether or not the network and its variables should be reused. To be
      able to reuse 'scope' must be given.
    scope: Optional variable_scope.
    create_aux_logits: Whether to include the auxilliary logits.

  Returns:
    logits: the logits outputs of the model.
    end_points: the set of end_points from the inception model.
  """
  end_points = {}

  with tf.variable_scope(scope, 'InceptionResnetV2', [inputs, num_classes],
                         reuse=reuse) as scope:
    with slim.arg_scope([slim.batch_norm, slim.dropout],
                        is_training=is_training):

      net, end_points = inception_resnet_v2_base(inputs, scope=scope)

      if create_aux_logits:
        with tf.variable_scope('AuxLogits'):
          aux = end_points['PreAuxLogits']
          aux = slim.avg_pool2d(aux, 5, stride=3, padding='VALID',
                                scope='Conv2d_1a_3x3')
          aux = slim.conv2d(aux, 128, 1, scope='Conv2d_1b_1x1')
          aux = slim.conv2d(aux, 768, aux.get_shape()[1:3],
                            padding='VALID', scope='Conv2d_2a_5x5')
          aux = slim.flatten(aux)
          aux = slim.fully_connected(aux, num_classes, activation_fn=None,
                                     scope='Logits')
          end_points['AuxLogits'] = aux

      with tf.variable_scope('Logits'):
        net = slim.avg_pool2d(net, net.get_shape()[1:3], padding='VALID',
                              scope='AvgPool_1a_8x8')
        net = slim.flatten(net)

        net = slim.dropout(net, dropout_keep_prob, is_training=is_training,
                           scope='Dropout')

        end_points['PreLogitsFlatten'] = net
        # end_points['yjr_feature'] = tf.squeeze(net, axis=0)

        logits = slim.fully_connected(net, num_classes, activation_fn=None,
                                      scope='Logits')
        end_points['Logits'] = logits
        end_points['Predictions'] = tf.nn.softmax(logits, name='Predictions')

    return logits, end_points
def inception_resnet_v2 ( inputs , num_classes = 1001 , is_training = True , dropout_keep_prob = 0.8 , #0.8 reuse = None , scope = 'InceptionResnetV2' , create_aux_logits = True ) : end_points = { } with tf . variable_scope ( scope , 'InceptionResnetV2' , [ inputs , num_classes ] , reuse = reuse ) as scope : with slim . arg_scope ( [ slim . batch_norm , slim . dropout ] , is_training = is_training ) : net , end_points = inception_resnet_v2_base ( inputs , scope = scope ) if create_aux_logits : with tf . variable_scope ( 'AuxLogits' ) : aux = end_points [ 'PreAuxLogits' ] aux = slim . avg_pool2d ( aux , 5 , stride = 3 , padding = 'VALID' , scope = 'Conv2d_1a_3x3' ) aux = slim . conv2d ( aux , 128 , 1 , scope = 'Conv2d_1b_1x1' ) aux = slim . conv2d ( aux , 768 , aux . get_shape ( ) [ 1 : 3 ] , padding = 'VALID' , scope = 'Conv2d_2a_5x5' ) aux = slim . flatten ( aux ) aux = slim . fully_connected ( aux , num_classes , activation_fn = None , scope = 'Logits' ) end_points [ 'AuxLogits' ] = aux with tf . variable_scope ( 'Logits' ) : net = slim . avg_pool2d ( net , net . get_shape ( ) [ 1 : 3 ] , padding = 'VALID' , scope = 'AvgPool_1a_8x8' ) net = slim . flatten ( net ) net = slim . dropout ( net , dropout_keep_prob , is_training = is_training , scope = 'Dropout' ) end_points [ 'PreLogitsFlatten' ] = net # end_points['yjr_feature'] = tf.squeeze(net, axis=0) logits = slim . fully_connected ( net , num_classes , activation_fn = None , scope = 'Logits' ) end_points [ 'Logits' ] = logits end_points [ 'Predictions' ] = tf . nn . softmax ( logits , name = 'Predictions' ) return logits , end_points