TensorRT: IPluginCreator not found in Plugin Registry error when deserializing engine model

Description

I train yolov5 using pytorch, and convert it to tensorrt engine file. When converting I use REGISTER_TENSORRT_PLUGIN(YoloPluginCreator) to register my custom plugin. When loading the engine file, I try to deserialize it but failed, below is the error infomation:

[04/11/2022-20:45:35] [E] [TRT] 1: [pluginV2Runner.cpp::nvinfer1::rt::load::290] Error Code 1: Serialization (Serialization assertion creator failed.Cannot deserialize plugin since corresponding IPluginCreator not found in Plugin Registry)
[04/11/2022-20:45:35] [E] [TRT] 4: [runtime.cpp::nvinfer1::Runtime::deserializeCudaEngine::50] Error Code 4: Internal Error (Engine deserialization failed.)

I have added initLibNvInferPlugins(&gLogger, ""); before serialization but that doesn’t work for me.

Environment

TensorRT Version: 7.2.3.4 NVIDIA GPU: GeForce GTX 1660 Ti NVIDIA Driver Version: 496.49 CUDA Version: 11.0 CUDNN Version: 8.1.1 Operating System: windows11 Python Version (if applicable): Tensorflow Version (if applicable): PyTorch Version (if applicable): 1.11.0 Baremetal or Container (if so, version):

Relevant Files

Steps To Reproduce

serialize: image image image

deserialize: image

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 15

Most upvoted comments

$ trtexec --help " --plugins Plugin library (.so) to load (can be specified multiple times)"

The lib comes from two ways:

  1. the TensorRT itself provides lots of plugin libs in https://developer.nvidia.com/nvidia-tensorrt-8x-download
  2. you can compile it, and add your self-implemented plugin lib together with TRT-OSS