Hi @mchi, I have replaced the trt plugin library using the prebuild lib and following instructions as described in step 3, I have the same environment as it was built (running from docker image nvcr.io/nvidia/tensorrt:20.03-py3
) but got the same error [8] No importer registered for op: BatchedNMS_TRT
.
Replacing the lib
// Backup original libnvinfer_plugin.so.7.0.0
$ root@xxx:/workspace# mv libnvinfer_plugin.so.7.0.0 /workspace/libnvinfer_plugin.so.7.0.0.back
// Download the prebuild plugin
$ root@xxx:/workspace# wget https://nvidia.box.com/shared/static/o4gt2b50qfga71qd3kognf0v9iv6o2hx.1 -O libnvinfer_plugin.so.7.0.0.1
// Only replace the real file, don’t touch the link files, e.g. libnvinfer_plugin.so, libnvinfer_plugin.so.7
$ cp libnvinfer_plugin.so.7.0.0.1 /usr/lib/x86_64-linux-gnu/libnvinfer_plugin.so.7.0.0
$ sudo ldconfig
Converting the onnx model with trtexec
// Run the trtexec command with the new plugin
$ root@xxx:/workspace# trtexec --onnx=onnx-tensorrt/models/yolov3-10-with-plugin.onnx --saveEngine=/workspace/onnx-tensorrt/models/optimized_yolov3.trt --int8 --verbose
Error:
…
02/04/2021-21:07:19] [V] [TRT] Plugin creator registration succeeded - ::Normalize_TRT
[02/04/2021-21:07:19] [V] [TRT] Plugin creator registration succeeded - ::RPROI_TRT
[02/04/2021-21:07:19] [V] [TRT] Plugin creator registration succeeded - ::BatchedNMS_TRT
[02/04/2021-21:07:19] [V] [TRT] Plugin creator registration succeeded - ::FlattenConcat_TRT
[02/04/2021-21:07:19] [V] [TRT] Plugin creator registration succeeded - ::CropAndResize
[02/04/2021-21:07:19] [V] [TRT] Plugin creator registration succeeded - ::Proposal
[02/04/2021-21:07:19] [V] [TRT] Plugin creator registration succeeded - ::BatchTilePlugin_TRT
[02/04/2021-21:07:19] [V] [TRT] Plugin creator registration succeeded - ::DetectionLayer_TRT
[02/04/2021-21:07:19] [V] [TRT] Plugin creator registration succeeded - ::ProposalLayer_TRT
[02/04/2021-21:07:19] [V] [TRT] Plugin creator registration succeeded - ::PyramidROIAlign_TRT
[02/04/2021-21:07:19] [V] [TRT] Plugin creator registration succeeded - ::ResizeNearest_TRT
[02/04/2021-21:07:19] [V] [TRT] Plugin creator registration succeeded - ::SpecialSlice_TRT
[02/04/2021-21:07:19] [V] [TRT] Plugin creator registration succeeded - ::InstanceNormalization_TRT
[02/04/2021-21:07:19] [V] [TRT] Plugin creator registration succeeded - ::GenerateDetection_TRT
[02/04/2021-21:07:19] [V] [TRT] Plugin creator registration succeeded - ::MultilevelProposeROI_TRT
[02/04/2021-21:07:19] [V] [TRT] Plugin creator registration succeeded - ::MultilevelCropAndResize_TRT
…
Input filename: onnx-tensorrt/models/yolov3-10-with-plugin.onnx
ONNX IR version: 0.0.7
Opset version: 10
Producer name:
Producer version:
Domain:
Model version: 0
Doc string:
…
[02/04/2021-21:07:19] [V] [TRT] Plugin creator registration succeeded - ONNXTRT_NAMESPACE::GridAnchor_TRT
[02/04/2021-21:07:19] [V] [TRT] Plugin creator registration succeeded - ONNXTRT_NAMESPACE::NMS_TRT
[02/04/2021-21:07:19] [V] [TRT] Plugin creator registration succeeded - ONNXTRT_NAMESPACE::Reorg_TRT
[02/04/2021-21:07:19] [V] [TRT] Plugin creator registration succeeded - ONNXTRT_NAMESPACE::Region_TRT
[02/04/2021-21:07:19] [V] [TRT] Plugin creator registration succeeded - ONNXTRT_NAMESPACE::PriorBox_TRT
[02/04/2021-21:07:19] [V] [TRT] Plugin creator registration succeeded - ONNXTRT_NAMESPACE::Normalize_TRT
[02/04/2021-21:07:19] [V] [TRT] Plugin creator registration succeeded - ONNXTRT_NAMESPACE::RPROI_TRT
[02/04/2021-21:07:19] [V] [TRT] Plugin creator registration succeeded - ONNXTRT_NAMESPACE::BatchedNMS_TRT
[02/04/2021-21:07:19] [V] [TRT] Plugin creator registration succeeded - ONNXTRT_NAMESPACE::FlattenConcat_TRT
[02/04/2021-21:07:19] [V] [TRT] Plugin creator registration succeeded - ONNXTRT_NAMESPACE::CropAndResize
[02/04/2021-21:07:19] [V] [TRT] Plugin creator registration succeeded - ONNXTRT_NAMESPACE::Proposal
…
[02/04/2021-18:21:56] [W] [TRT] /workspace/onnx-tensorrt/onnx2trt_utils.cpp:235: Your ONNX model has been generated with INT64 weights, while TensorRT does not natively sup port INT64. Attempting to cast down to INT32.
[02/04/2021-18:21:56] [W] [TRT] /workspace/onnx-tensorrt/onnx2trt_utils.cpp:261: One or more weights outside the range of INT32 was clamped
[02/04/2021-18:21:56] [W] [TRT] /workspace/onnx-tensorrt/onnx2trt_utils.cpp:261: One or more weights outside the range of INT32 was clamped
While parsing node number 467 [BatchedNMS_TRT]:
ERROR: /workspace/onnx-tensorrt/ModelImporter.cpp:134 In function parseGraph:
[8] No importer registered for op: BatchedNMS_TRT
[02/04/2021-18:21:56] [E] Failed to parse onnx file
[02/04/2021-18:21:56] [E] Parsing model failed
[02/04/2021-18:21:56] [E] Engine creation failed
[02/04/2021-18:21:56] [E] Engine set up failed
&&&& FAILED TensorRT.trtexec # trtexec --onnx=onnx-tensorrt/models/yolov3-10-with-plugin.onnx --saveEngine=/workspace/onnx-tensorrt/models/optimized_yolov3.trt --int8 --verbose
It seems that the register for the custom importer BatchedNMS_TRT
plugin is still missing, what about the solution proposed by @pranavm-nvidia and pointed above to add a custom importer for BatchedNMS_TRT
in builtin_op_importers.cpp
with TRT 7.0.0.?