def load_vgg(sess, vgg_path):
    '\n    Load Pretrained VGG Model into TensorFlow.\n    :param sess: TensorFlow Session\n    :param vgg_path: Path to vgg folder, containing "variables/" and "saved_model.pb"\n    :return: Tuple of Tensors from VGG model (image_input, keep_prob, layer3_out, layer4_out, layer7_out)\n    '
    vgg_tag = 'vgg16'
    tf.saved_model.loader.load(sess, [vgg_tag], vgg_path)
    vgg_input_tensor_name = 'image_input:0'
    vgg_keep_prob_tensor_name = 'keep_prob:0'
    vgg_layer3_out_tensor_name = 'layer3_out:0'
    vgg_layer4_out_tensor_name = 'layer4_out:0'
    vgg_layer7_out_tensor_name = 'layer7_out:0'
    graph = tf.get_default_graph()
    input_img = graph.get_tensor_by_name(vgg_input_tensor_name)
    prob = graph.get_tensor_by_name(vgg_keep_prob_tensor_name)
    layer3_o = graph.get_tensor_by_name(vgg_layer3_out_tensor_name)
    layer4_o = graph.get_tensor_by_name(vgg_layer4_out_tensor_name)
    layer7_o = graph.get_tensor_by_name(vgg_layer7_out_tensor_name)
    return (input_img, prob, layer3_o, layer4_o, layer7_o)
Load Pretrained VGG Model into TensorFlow.
:param sess: TensorFlow Session
:param vgg_path: Path to vgg folder, containing "variables/" and "saved_model.pb"
:return: Tuple of Tensors from VGG model (image_input, keep_prob, layer3_out, layer4_out, layer7_out)
def load_vgg(sess, vgg_path):
    '\n    Load Pretrained VGG Model into TensorFlow.\n    :param sess: TensorFlow Session\n    :param vgg_path: Path to vgg folder, containing "variables/" and "saved_model.pb"\n    :return: Tuple of Tensors from VGG model (image_input, keep_prob, layer3_out, layer4_out, layer7_out)\n    '
    vgg_tag = 'vgg16'
    tf.saved_model.loader.load(sess, [vgg_tag], vgg_path)
    vgg_input_tensor_name = 'image_input:0'
    vgg_keep_prob_tensor_name = 'keep_prob:0'
    vgg_layer3_out_tensor_name = 'layer3_out:0'
    vgg_layer4_out_tensor_name = 'layer4_out:0'
    vgg_layer7_out_tensor_name = 'layer7_out:0'
    graph = tf.get_default_graph()
    input_img = graph.get_tensor_by_name(vgg_input_tensor_name)
    prob = graph.get_tensor_by_name(vgg_keep_prob_tensor_name)
    layer3_o = graph.get_tensor_by_name(vgg_layer3_out_tensor_name)
    layer4_o = graph.get_tensor_by_name(vgg_layer4_out_tensor_name)
    layer7_o = graph.get_tensor_by_name(vgg_layer7_out_tensor_name)
    return (input_img, prob, layer3_o, layer4_o, layer7_o)