Importing Caffe's PriorBox

I’ve searched the board and read every post that mentions “PriorBox”, and while there seems to be a Python node that implements PriorBox and sampleUffSSD.cpp handles PriorBox with UFF, I cannot see what needs to be done with a Caffe file that uses PriorBox.

Specifically, we have a layer like this:

layer {
    name: "foo"
    type: "PriorBox"
    prior_box_param { # ERROR HERE
        # whatever
    }
    # etc
}

Now, following the code in sampleMNIST I try to import my model into TensorRT but get an error:

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

Searching around, this is a known issue and there is even a TensorRT class nvinfer1::plugin::PriorBoxParameters that suggests it should be able to handle this layer, but there is little or documentation on how to proceed. I read one suggestion about splitting the model, but there are four instances of this node in my model, and more importantly, there is no information about what code should be in a custom node.

How should I handle this with minimal impact on the existing model that has been designed and trained by a third-party, so I cannot alter either the model or the weights.

Did you find any solutions for this? I’m parsing the SSD-Mobilenet’s caffe prototxt using caffe parser. This error occurs at the following layer.

layer {
  name: "conv11_mbox_priorbox"
  type: "PriorBox"
  bottom: "conv11"
  bottom: "data"
  top: "conv11_mbox_priorbox"
  prior_box_param {
    min_size: 60.0
    aspect_ratio: 2.0
    flip: true
    clip: false
    variance: 0.1
    variance: 0.1
    variance: 0.2
    variance: 0.2
    offset: 0.5
  }
}

Do we have to implement a custom layer or plugin for this layer for parsing?

you can refer to GitHub - Ghustwb/MobileNet-SSD-TensorRT: Accelerate mobileNet-ssd with tensorRT

Thanks @rawk.vx