(sess)
return pool3
Prepares inception net for batched usage and returns pool_3 layer.

    Args:
        sess (Session): TensorFlow Session object.

    Returns:
        TensorFlow graph node representing inception model pool3 layer output.
Prepares inception net for batched usage and returns pool_3 layer.
Prepares inception net for batched usage and returns pool_3 layer .
def _get_inception_layer(sess):
    """
    Prepares inception net for batched usage and returns pool_3 layer.

    Args:
        sess (Session): TensorFlow Session object.

    Returns:
        TensorFlow graph node representing inception model pool3 layer output.

    """
    # Get the output node
    layer_name = 'inception_model/pool_3:0'
    pool3 = sess.graph.get_tensor_by_name(layer_name)

    # Reshape to be batch size agnostic
    ops = pool3.graph.get_operations()
    for op_idx, op in enumerate(ops):
        for o in op.outputs:
            shape = o.get_shape()
            if len(shape._dims) > 0:
                try:
                    shape = [s.value for s in shape]
                except AttributeError: # TF 2 uses None shape directly. No conversion needed.
                    shape = shape

                new_shape = []
                for j, s in enumerate(shape):
                    if s == 1 and j == 0:
                        new_shape.append(None)
                    else:
                        new_shape.append(s)
                o.__dict__['_shape_val'] = tf.TensorShape(new_shape)

    return pool3
def _get_inception_layer ( sess ) : # Get the output node layer_name = 'inception_model/pool_3:0' pool3 = sess . graph . get_tensor_by_name ( layer_name ) # Reshape to be batch size agnostic ops = pool3 . graph . get_operations ( ) for op_idx , op in enumerate ( ops ) : for o in op . outputs : shape = o . get_shape ( ) if len ( shape . _dims ) > 0 : try : shape = [ s . value for s in shape ] except AttributeError : # TF 2 uses None shape directly. No conversion needed. shape = shape new_shape = [ ] for j , s in enumerate ( shape ) : if s == 1 and j == 0 : new_shape . append ( None ) else : new_shape . append ( s ) o . __dict__ [ '_shape_val' ] = tf . TensorShape ( new_shape ) return pool3