将caffe的PriorBox导入TensorRT

Ken*_*Y-N 7 c++ caffe tensorrt

我们有一个Caffe模型,其中包含:

layer {
    name: "foo"
    type: "PriorBox"
    prior_box_param { # ERROR HERE
        # whatever
    }
    # etc
}
Run Code Online (Sandbox Code Playgroud)

现在,按照sampleMNIST我的代码尝试将我的模型导入TensorRT但得到一个错误:

Error parsing text-format ditcaffe.NetParameter: 1000:19 ("ERROR HERE" location):
   Message type "ditcaffe.LayerParameter" has no field named "prior_box_param".
Run Code Online (Sandbox Code Playgroud)

搜索周围,这是一个已知问题,甚至有一个TensorRTnvinfer1::plugin::PriorBoxParameters表明它应该能够处理这一层,但很少或有关于如何继续的文档.我读了一个关于拆分模型的建议,但是我的模型中有四个这个节点的实例,更重要的是,没有关于自定义节点中应该有什么代码的信息.

我应该如何处理这个问题,而对第三方设计和培训的现有模型的影响最小,因此我无法彻底改变模型或权重.