mmdeploy icon indicating copy to clipboard operation
mmdeploy copied to clipboard

[Bug] I Can't convert rtmpose3D to tensorRT

Open zszz3 opened this issue 3 months ago • 0 comments

Checklist

  • [x] I have searched related issues but cannot get the expected help.
  • [x] 2. I have read the FAQ documentation but cannot get the expected help.
  • [x] 3. The bug has not been fixed in the latest version.

Describe the bug

when I use mmdeploy, I meet this bug

  warnings.warn(
2025-10-08:00:24:09 - root - ERROR - decode() missing 2 required positional arguments: 'y' and 'z'
Traceback (most recent call last):
  File "/home/gyh/mmtest/mmdeploy/mmdeploy/utils/utils.py", line 41, in target_wrapper
    result = target(*args, **kwargs)
  File "/home/gyh/mmtest/mmdeploy/mmdeploy/apis/visualize.py", line 72, in visualize_model
    result = model.test_step(model_inputs)[0]
  File "/home/gyh/.conda/envs/yolov8-tensorRT/lib/python3.8/site-packages/mmengine/model/base_model/base_model.py", line 145, in test_step
    return self._run_forward(data, mode='predict')  # type: ignore
  File "/home/gyh/.conda/envs/yolov8-tensorRT/lib/python3.8/site-packages/mmengine/model/base_model/base_model.py", line 361, in _run_forward
    results = self(**data, mode=mode)
  File "/home/gyh/.conda/envs/yolov8-tensorRT/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1553, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/home/gyh/.conda/envs/yolov8-tensorRT/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1562, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/gyh/mmtest/mmdeploy/mmdeploy/codebase/mmpose/deploy/pose_detection_model.py", line 122, in forward
    preds = self.head.decode(batch_outputs[0])
  File "/home/gyh/mmtest/mmpose/projects/rtmpose3d/rtmpose3d/rtmw3d_head.py", line 238, in decode
    keypoints, keypoints_simcc, scores = _pack_and_call(
  File "/home/gyh/mmtest/mmpose/projects/rtmpose3d/rtmpose3d/rtmw3d_head.py", line 225, in _pack_and_call
    return func(*args)
TypeError: decode() missing 2 required positional arguments: 'y' and 'z'
10/08 00:24:10 - mmengine - ERROR - tools/deploy.py - create_process - 82 - visualize tensorrt model failed.

Reproduction

I use

python tools/deploy.py     configs/mmpose/pose-detection_simcc_tensorrt-fp16_dynamic-384x288.py  ../mmpose/projects/rtmpose3d/configs/rtmw3d-l_8xb64_cocktail14-384x288.py     ../mmpose/projects/rtmpose3d/rtmw3d-l_8xb64_cocktail14-384x288-794dbc78_20240626.pth   demo/resources/human-pose.jpg     --work-dir rtmpose3d_st/     --device cuda     --show

configs/mmpose/pose-detection_simcc_tensorrt-fp16_dynamic-384x288.py is

_base_ = ['./pose-detection_static.py', '../_base_/backends/tensorrt-fp16.py']
onnx_config = dict(
    input_shape=[384, 288],
    output_names=['output1', 'output2', 'output3'],
    dynamic_axes={
        'input': {
            0: 'batch',
        },
        'output1': {
            0: 'batch'
        },
        'output2': {
            0: 'batch'
        },
        'output3': {
            0: 'batch'
        }
    })

backend_config = dict(
    common_config=dict(max_workspace_size=1 << 30),
    model_inputs=[
        dict(
            input_shapes=dict(
                input=dict(
                    min_shape=[1, 3, 384, 288],
                    opt_shape=[2, 3, 384, 288],
                    max_shape=[20, 3, 384, 288])))
    ])

Environment

mmdeploy                 1.3.1
mmdeploy-runtime-gpu     1.3.1
mmdet                    3.1.0
mmengine                 0.10.7
mmpose                   1.3.2

Error traceback


zszz3 avatar Oct 08 '25 08:10 zszz3