TensorRT - "could not parse layer type IPlugin" ??

I have written a C++ code following TensorRT API and the model I want to build also have layers in the model.prototxt file that are not supported by TensorRT, so I had to write code for them using IPlugin.

So this is the snippet of the code layer in the .prototxt file:

layer {
  name: "upsample4_0_4"
  type: "IPlugin"
  bottom: "conv4_0_4"
  bottom: "pool2_0_4_mask"
  top: "upsample4_0_4"

I successfully compiled the code but when I run the executable, it gives me the following error:

Model: bn_conv_merged_weights.caffemodel
Begin parsing model...
could not parse layer type IPlugin
End parsing model...
Segmentation fault (core dumped)

Any idea on how to get rid of this?
Thank you

I have the same problem, how to solve it ?



Has anyone of you figured out the way to solve it ?


I’m working with Python, trying to create an engine for the sampleFasterRCNN model provided with TensorRT (version 4 by the way). I get the same error:

could not parse layer type IPlugin
[TensorRT] ERROR: Failed to parse caffe model
  File "/usr/lib/python2.7/dist-packages/tensorrt/utils/_utils.py", line 352, in caffe_to_trt_engine
Traceback (most recent call last):
  File "tensorRT_conversionFasterRCNN.py", line 38, in <module>
  File "/usr/lib/python2.7/dist-packages/tensorrt/utils/_utils.py", line 360, in caffe_to_trt_engine
    raise AssertionError('Caffe parsing failed on line {} in statement {}'.format(line, text))
AssertionError: Caffe parsing failed on line 352 in statement assert(blob_name_to_tensor)

Can anyone explain why this is happening?

I have the problem too.

I got the same problem. Any idea on how to solve it?

The version of TensorRT that i used is 5.0.2


Hi Antonio et all,

TensorRT doesn’t know how to parse your layer with type “IPlugin” unless you tell it how to. You do this by using their “plugin” API. The plugin API requires you to write a class, a “factory” which can recognize your plugin layers from a prototxt and then instantiate them. In the TensorRT samples, check out samplePlugin.

Good luck,