classifier.py 文件源码

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

项目:SmartSlam 作者: Oneiroe 项目源码 文件源码
def load_graph(frozen_graph_filename):
    """ Load graph/model to be used """
    logging.info('Loading frozen model-graph: ' + frozen_graph_filename)
    # We load the protobuf file from the disk and parse it to retrieve the
    # unserialized graph_def
    logging.debug('Reading model file')
    with tf.gfile.GFile(frozen_graph_filename, "rb") as f:
        graph_def = tf.GraphDef()
        graph_def.ParseFromString(f.read())

    # Then, we can use again a convenient built-in function to import a graph_def into the
    # current default Graph
    logging.debug('Importing graph')
    with tf.Graph().as_default() as graph:
        tf.import_graph_def(
            graph_def,
            input_map=None,
            return_elements=None,
            name="prefix",
            op_dict=None,
            producer_op_list=None
        )
    return graph
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号