[Bug]convert RTMDet to tensorrt on orin: cannot import name 'cfg_apply_marks' from 'mmdeploy.utils'
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
I use sh tools/scripts/build_jetson_orin_python38.sh to build the environment on orin. After source env, I start to convert model using comand below:
python3 tools/deploy.py
configs/mmdet/detection/detection_tensorrt_static-640x640.py
../mmpose/projects/rtmpose/rtmdet/person/rtmdet_m_640-8xb32_coco-person.py
https://download.openmmlab.com/mmpose/v1/projects/rtmpose/rtmdet_m_8xb32-100e_coco-obj365-person-235e8209.pth
demo/resources/human-pose.jpg
--work-dir rtmpose-trt/rtmdet-ges
--device cuda:0
--show
--dump-info
But!!!! the import error occur
how to solve it please!!!!
Reproduction
python3 tools/deploy.py
configs/mmdet/detection/detection_tensorrt_static-640x640.py
../mmpose/projects/rtmpose/rtmdet/person/rtmdet_m_640-8xb32_coco-person.py
https://download.openmmlab.com/mmpose/v1/projects/rtmpose/rtmdet_m_8xb32-100e_coco-obj365-person-235e8209.pth
demo/resources/human-pose.jpg
--work-dir rtmpose-trt/rtmdet-ges
--device cuda:0
--show
--dump-info
Environment
tools/scripts/build_jetson_orin_python38.sh to build the environment on orin.
Error traceback
Traceback (most recent call last):
File "tools/deploy.py", line 12, in <module>
from mmdeploy.apis import (create_calib_input_data, extract_model,
File "/home/jetson/mmdeploy/mmdeploy/__init__.py", line 8, in <module>
importlib.import_module('mmdeploy.pytorch')
File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/home/jetson/mmdeploy/mmdeploy/pytorch/__init__.py", line 2, in <module>
from . import functions # noqa: F401,F403
File "/home/jetson/mmdeploy/mmdeploy/pytorch/functions/__init__.py", line 2, in <module>
from . import adaptive_pool # noqa: F401,F403
File "/home/jetson/mmdeploy/mmdeploy/pytorch/functions/adaptive_pool.py", line 6, in <module>
from mmdeploy.core import FUNCTION_REWRITER
File "/home/jetson/mmdeploy/mmdeploy/core/__init__.py", line 2, in <module>
from .optimizers import * # noqa: F401,F403
File "/home/jetson/mmdeploy/mmdeploy/core/optimizers/__init__.py", line 3, in <module>
from .function_marker import mark, reset_mark_function_count
File "/home/jetson/mmdeploy/mmdeploy/core/optimizers/function_marker.py", line 8, in <module>
from mmdeploy.utils import IR, cfg_apply_marks, get_partition_config
ImportError: cannot import name 'cfg_apply_marks' from 'mmdeploy.utils' (/home/jetson/mmdeploy/mmdeploy/utils/__init__.py)
I encounter the same issue.
Anyone could help? please.
macOS
just installed mmdeploy
i try to run import mmdeploy to verify the installation
then the same ImportError occurred
ImportError: cannot import name 'cfg_apply_marks' from 'mmdeploy.utils' (/Users/username/mmdeploy-main/mmdeploy/utils/__init__.py)
diff --git a/mmdeploy/utils/__init__.py b/mmdeploy/utils/__init__.py
old mode 100644
new mode 100755
index 1c1865b6..298e9614
--- a/mmdeploy/utils/__init__.py
+++ b/mmdeploy/utils/__init__.py
@@ -5,6 +5,7 @@ from .constants import IR, SDK_TASK_MAP, Backend, Codebase, Task
from .device import parse_cuda_device_id, parse_device_id, parse_device_type
from .env import get_backend_version, get_codebase_version, get_library_version
from .utils import get_file_path, get_root_logger, target_wrapper
+from .config_utils import *
__all__ = [
'SDK_TASK_MAP', 'IR', 'Backend', 'Codebase', 'Task'
remember to install mmcv