Tutorial for serializing custom layer in TensorRT

Hi, I am trying to serialize the tensorrt engine to a plain file. However, there are custom layers in my model, and I have no idea how to implement getSerializationSize and serialize.Is there any tutorial for implementing these two functions?

Hello, I’d recommend looking at the https://github.com/AastaNV/Face-Recognition example.

Samples demonstrate Plugin API.(SamplePlugin and SampleFasterRCNN)

Hi, I am working on implementing 3d convolution plugin, which is more complicated than the tutorials you provide. I am looking into https://github.com/NVIDIA-Jetson/redtail/blob/master/stereoDNN/lib/conv3d_plugin.cpp. However, they didn’t implement these two functions. I think the main question is that there are variables of different types, and I don’t know how to serialize them into buffer since the example in Face-Recognition (e.g. bBoxMergeLayer) assumes there are only one type of variable, which is int, needs serialization.

BTW, I assume that the serialization must be done for all layer variables even though there are dependencies between variables, e.g. kernel_weights_d_ and kernel_weights in conv3DPlugin in StereoDNN. Am I right, or the assignment of variables can be done in deserialization so I just need to do it for some variables.