I met some problem with Tensorrt 5.1 c++ api. I use 5.1 python api to convert a retinanet onnx model to tensorrt engine and serialize it. When I tried to deserialize it using c++ api I met the following error:
getPluginCreator could not find plugin ResizeNearest version 001 namespace
Cannot deserialize plugin ResizeNearest
The serialize code is:
with trt.OnnxParser(network, TRT_LOGGER) as parser:
with open(os.path.join(net_folder, ‘model.onnx’), ‘rb’) as model:
if not parser.parse(model.read()):
logging.info(‘onnx parser failed!’)
engine = builder.build_cuda_engine(network)
with open(engine_file, ‘wb’) as f:
deserialize code is :
IRuntime* runtime = createInferRuntime(logger);
_cuda_engine = runtime->deserializeCudaEngine(engine_buf,
The error is strange because ResizeNearest is the op name in caffe2 retinanet model, in ONNX format it is called Upsample. And I can also use tensorrt 5.1 python api to deserialize it and do inference properly. Is there a gap between c++ api and python api or I missed linking some library?
Pls give some hints. Thanks!