Can anyone provide some examples about how to define custom layers for onnx model?

TensorRT version:

Question: How to define custom layers for onnx model? Any example will be helpful. thx!


I notice that NvOnnxParserRuntime.h provides the API IPluginFactory* createPluginFactory for onnx custom layers, however, I cannot find any examples about how to use this API. By the way, the official doc only provides examples for caffe and uff model.

Although it is possible to compile onnxparser library based on the open source project onnx_trt [url][/url], I don’t think it is a good way to address my issue.


unfortunately, we don’t currently have custom layer examples for onnx models. I will provide your feedback to the engineering team.

I meet same problem, official answer is replacing from onnx-tensorrt builded library

@xautlxf can you explain your answer a bit? So in order to use

IPluginFactory* createPluginFactory

for custom layers we need to replace

in the tensorrt installation?

Are there any news?
I’m also looking for an End2End example to implement and load an Onnx custom layer as a plugin…