Closed kc-w closed 1 year ago
We recommend using English or English & Chinese for issues so that we could have broader discussion.
@kc-w hi, did you build the custom ops for tensorrt? pls. refer to https://mmdeploy.readthedocs.io/en/latest/05-supported-backends/tensorrt.html#build-custom-ops
ok,There is no problem!
请问你怎么解决的,我也遇见了同样的问题。
Checklist
Describe the bug
06/08 16:37:22 - mmengine - WARNING - Failed to search registry with scope "mmrotate" in the "Codebases" registry tree. As a workaround, the current "Codebases" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmrotate" is a correct scope, or whether the registry is initialized. 06/08 16:37:22 - mmengine - WARNING - Failed to search registry with scope "mmrotate" in the "mmrotate_tasks" registry tree. As a workaround, the current "mmrotate_tasks" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmrotate" is a correct scope, or whether the registry is initialized. 06/08 16:37:24 - mmengine - INFO - Start pipeline mmdeploy.apis.pytorch2onnx.torch2onnx in subprocess 06/08 16:37:26 - mmengine - WARNING - Failed to search registry with scope "mmrotate" in the "Codebases" registry tree. As a workaround, the current "Codebases" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmrotate" is a correct scope, or whether the registry is initialized. 06/08 16:37:26 - mmengine - WARNING - Failed to search registry with scope "mmrotate" in the "mmrotate_tasks" registry tree. As a workaround, the current "mmrotate_tasks" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmrotate" is a correct scope, or whether the registry is initialized. Loads checkpoint by local backend from path: E:/DLTrainKit/x64/Release/DeepLearningProject/Project_002/temp/epoch_200.pth 06/08 16:37:28 - mmengine - WARNING - "FileClient" will be deprecated in future. Please use io functions in https://mmengine.readthedocs.io/en/latest/api/fileio.html#file-io 06/08 16:37:28 - mmengine - WARNING - "HardDiskBackend" is the alias of "LocalBackend" and the former will be deprecated in future. 06/08 16:37:29 - mmengine - WARNING - DeprecationWarning: get_onnx_config will be deprecated in the future. 06/08 16:37:29 - mmengine - INFO - Export PyTorch model to ONNX: E:\projectTest\mmdeploy-1.0.0\tools/rtmdet_fp16\end2end.onnx. 06/08 16:37:29 - mmengine - WARNING - Can not find torch._C._jit_pass_onnx_autograd_function_process, function rewrite will not be applied 06/08 16:37:29 - mmengine - WARNING - Can not find torch._C._jit_pass_onnx_deduplicate_initializers, function rewrite will not be applied 06/08 16:37:29 - mmengine - WARNING - Can not find mmdet.models.utils.transformer.PatchMerging.forward, function rewrite will not be applied E:\projectTest\mmdeploy-1.0.0\mmdeploy\codebase\mmdet\models\detectors\single_stage.py:84: TracerWarning: Iterating over a tensor might cause the trace to be incorrect. Passing a tensor of different shape won't change the number of iterations executed (and might lead to errors or silently give incorrect results). img_shape = [int(val) for val in img_shape] E:\projectTest\mmdeploy-1.0.0\mmdeploy\codebase\mmdet\models\detectors\single_stage.py:84: TracerWarning: Converting a tensor to a Python integer might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! img_shape = [int(val) for val in img_shape] E:\projectTest\mmdeploy-1.0.0\mmdeploy\core\optimizers\function_marker.py:160: TracerWarning: Converting a tensor to a Python integer might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! ys_shape = tuple(int(s) for s in ys.shape) D:\Python\Python39\lib\site-packages\torch\functional.py:568: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\TensorShape.cpp:2228.) return _VF.meshgrid(tensors, kwargs) # type: ignore[attr-defined] E:\projectTest\mmdeploy-1.0.0\mmdeploy\pytorch\functions\mod.py:20: UserWarning: floordiv is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor'). return input - (input // other) other E:\projectTest\mmdeploy-1.0.0\mmdeploy\mmcv\ops\nms_rotated.py:303: TracerWarning: Converting a tensor to a Python integer might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! int(scores.shape[-1]), E:\projectTest\mmdeploy-1.0.0\mmdeploy\mmcv\ops\nms_rotated.py:121: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! out_boxes = min(num_boxes, after_topk) WARNING: The shape inference of mmdeploy::TRTBatchedRotatedNMS type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of mmdeploy::TRTBatchedRotatedNMS type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of mmdeploy::TRTBatchedRotatedNMS type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of mmdeploy::TRTBatchedRotatedNMS type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of mmdeploy::TRTBatchedRotatedNMS type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. WARNING: The shape inference of mmdeploy::TRTBatchedRotatedNMS type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function. 06/08 16:37:38 - mmengine - INFO - Execute onnx optimize passes. 06/08 16:37:39 - mmengine - INFO - Finish pipeline mmdeploy.apis.pytorch2onnx.torch2onnx 06/08 16:37:41 - mmengine - INFO - Start pipeline mmdeploy.apis.utils.utils.to_backend in subprocess 06/08 16:37:41 - mmengine - WARNING - Could not load the library of tensorrt plugins. Because the file does not exist: [06/08/2023-16:37:41] [TRT] [I] [MemUsageChange] Init CUDA: CPU +450, GPU +0, now: CPU 11288, GPU 1157 (MiB) [06/08/2023-16:37:42] [TRT] [I] [MemUsageChange] Init builder kernel library: CPU +346, GPU +104, now: CPU 11818, GPU 1261 (MiB) [06/08/2023-16:37:42] [TRT] [I] ---------------------------------------------------------------- [06/08/2023-16:37:42] [TRT] [I] Input filename: E:\projectTest\mmdeploy-1.0.0\tools/rtmdet_fp16\end2end.onnx [06/08/2023-16:37:42] [TRT] [I] ONNX IR version: 0.0.6 [06/08/2023-16:37:42] [TRT] [I] Opset version: 11 [06/08/2023-16:37:42] [TRT] [I] Producer name: pytorch [06/08/2023-16:37:42] [TRT] [I] Producer version: 1.11.0 [06/08/2023-16:37:42] [TRT] [I] Domain:
[06/08/2023-16:37:42] [TRT] [I] Model version: 0 [06/08/2023-16:37:42] [TRT] [I] Doc string:
[06/08/2023-16:37:42] [TRT] [I] ---------------------------------------------------------------- [06/08/2023-16:37:43] [TRT] [W] onnx2trt_utils.cpp:369: Your ONNX model has been generated with INT64 weights, while TensorRT does not natively support INT64. Attempting to cast down to INT32. [06/08/2023-16:37:43] [TRT] [W] onnx2trt_utils.cpp:395: One or more weights outside the range of INT32 was clamped Process Process-3: Traceback (most recent call last): File "D:\Python\Python39\lib\multiprocessing\process.py", line 315, in _bootstrap self.run() File "D:\Python\Python39\lib\multiprocessing\process.py", line 108, in run self._target(self._args, self._kwargs) File "E:\projectTest\mmdeploy-1.0.0\mmdeploy\apis\core\pipeline_manager.py", line 108, in call ret = func(*args, **kwargs) File "E:\projectTest\mmdeploy-1.0.0\mmdeploy\apis\utils\utils.py", line 100, in to_backend a = backend_mgr.to_backend( File "E:\projectTest\mmdeploy-1.0.0\mmdeploy\backend\tensorrt\backend_manager.py", line 127, in to_backend onnx2tensorrt( File "E:\projectTest\mmdeploy-1.0.0\mmdeploy\backend\tensorrt\onnx2tensorrt.py", line 79, in onnx2tensorrt from_onnx( File "E:\projectTest\mmdeploy-1.0.0\mmdeploy\backend\tensorrt\utils.py", line 185, in from_onnx raise RuntimeError(f'Failed to parse onnx, {error_msgs}') RuntimeError: Failed to parse onnx, In node 386 (importFallbackPluginImporter): UNSUPPORTED_NODE: Assertion failed: creator && "Plugin not found, are the plugin name, version, and namespace correct?"
[06/08/2023-16:37:43] [TRT] [I] No importer registered for op: TRTBatchedRotatedNMS. Attempting to import as plugin. [06/08/2023-16:37:43] [TRT] [I] Searching for plugin: TRTBatchedRotatedNMS, plugin_version: 1, plugin_namespace: [06/08/2023-16:37:43] [TRT] [E] ModelImporter.cpp:773: While parsing node number 386 [TRTBatchedRotatedNMS -> "dets"]: [06/08/2023-16:37:43] [TRT] [E] ModelImporter.cpp:774: --- Begin node --- [06/08/2023-16:37:43] [TRT] [E] ModelImporter.cpp:775: input: "mmdeploy::TRTBatchedRotatedNMS_1119" input: "y.4" output: "dets" output: "labels" name: "TRTBatchedRotatedNMS_386" op_type: "TRTBatchedRotatedNMS" attribute { name: "background_label_id" i: -1 type: INT } attribute { name: "clip_boxes" i: 0 type: INT } attribute { name: "iou_threshold" f: 0.1 type: FLOAT } attribute { name: "is_normalized" i: 0 type: INT } attribute { name: "keep_topk" i: 2000 type: INT } attribute { name: "num_classes" i: 1 type: INT } attribute { name: "score_threshold" f: 0.05 type: FLOAT } attribute { name: "topk" i: 3000 type: INT } domain: "mmdeploy"
[06/08/2023-16:37:43] [TRT] [E] ModelImporter.cpp:776: --- End node --- [06/08/2023-16:37:43] [TRT] [E] ModelImporter.cpp:779: ERROR: builtin_op_importers.cpp:4890 In function importFallbackPluginImporter: [8] Assertion failed: creator && "Plugin not found, are the plugin name, version, and namespace correct?" 06/08 16:37:43 - mmengine - ERROR - E:\projectTest\mmdeploy-1.0.0\mmdeploy\apis\core\pipeline_manager.py - pop_mp_output - 81 -
mmdeploy.apis.utils.utils.to_backend
with Call id: 1 failed. exit.Reproduction
Environment
Error traceback
No response