gan_metrics.py 文件源码

python
阅读 38 收藏 0 点赞 0 评论 0

项目:tefla 作者: openAGI 项目源码 文件源码
def run_image_classifier(tensor, graph_def, input_tensor,
                         output_tensor, scope='RunClassifier'):
    """Runs a network from a frozen graph.
    Args:
      tensor: An Input tensor.
      graph_def: A GraphDef proto.
      input_tensor: Name of input tensor in graph def.
      output_tensor: Name of output tensor in graph def.
      scope: Name scope for classifier.
    Returns:
      Classifier output. Shape depends on the classifier used, but is often
      [batch, classes].
    Raises:
      ValueError: If `image_size` is not `None`, and `tensor` are not the correct
        size.
    """
    input_map = {input_tensor: tensor}
    return_elements = [output_tensor]
    classifier_output = tf.import_graph_def(
        graph_def, input_map, return_elements, name=scope)[0]

    return classifier_output
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号