worker.py 文件源码

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

项目:Cuppa 作者: flipkart-incubator 项目源码 文件源码
def __load_caffe_model(self, blob_path, prototxt_path):
        """
        Load caffe model to memory
        Args:
            blob_path: Model in HDF5 format
            prototxt_path: Prototxt file. Contains Network implementation

        Returns:

        """
        net = caffe.Net(prototxt_path, blob_path, caffe.TEST)
        input_layer = net.inputs[0]
        output_layer = net.outputs[0]
        #height = net.blobs["data_q"].data.shape[2]
        #width = net.blobs["data_q"].data.shape[3]
        height = net.blobs[input_layer].data.shape[2]
        width = net.blobs[input_layer].data.shape[3]
        self.logger.info("Model has been successfully loaded from Blob:" + blob_path + " , Prototxt:" + prototxt_path)
        return net, height, width
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号