错误1、
Traceback (most recent call last):
File "tools/deploy.py", line 338, in
main()
File "tools/deploy.py", line 123, in main
deploy_cfg, model_cfg = load_config(deploy_cfg_path, model_cfg_path)
File "/opt/pyenv/versions/pytorch-1.8.1/lib/python3.8/site-packages/mmdeploy/utils/config_utils.py", line 29, in load_config
configs = [_load_config(cfg) for cfg in args]
File "/opt/pyenv/versions/pytorch-1.8.1/lib/python3.8/site-packages/mmdeploy/utils/config_utils.py", line 29, in
configs = [_load_config(cfg) for cfg in args]
File "/opt/pyenv/versions/pytorch-1.8.1/lib/python3.8/site-packages/mmdeploy/utils/config_utils.py", line 22, in _load_config
cfg = mmengine.Config.fromfile(cfg)
File "/opt/pyenv/versions/pytorch-1.8.1/lib/python3.8/site-packages/mmengine/config/config.py", line 490, in fromfile
raise e
File "/opt/pyenv/versions/pytorch-1.8.1/lib/python3.8/site-packages/mmengine/config/config.py", line 488, in fromfile
cfg_dict, imported_names = Config._parse_lazy_import(filename)
File "/opt/pyenv/versions/pytorch-1.8.1/lib/python3.8/site-packages/mmengine/config/config.py", line 1068, in _parse_lazy_import
raise ConfigParsingError(
mmengine.config.utils.ConfigParsingError: /opt/pyenv/versions/3.8.2/envs/pytorch-1.8.1/lib/python3.8/site-packages/mmpose/configs/base/default_runtime.py not found! It means that incorrect module is defined in with read_base(): = from mmpose.configs._base_.default_runtime import ..., please make sure the base config module is valid and is consistent with the prior import logic
错误2、
Traceback (most recent call last):
File "tools/deploy.py", line 338, in
main()
File "tools/deploy.py", line 129, in main
export2SDK(
File "/opt/pyenv/versions/pytorch-1.8.1/lib/python3.8/site-packages/mmdeploy/backend/sdk/export_info.py", line 352, in export2SDK
deploy_info = get_deploy(deploy_cfg, model_cfg, work_dir, device)
File "/opt/pyenv/versions/pytorch-1.8.1/lib/python3.8/site-packages/mmdeploy/backend/sdk/export_info.py", line 267, in getdeploy
, customs = get_model_name_customs(
File "/opt/pyenv/versions/pytorch-1.8.1/lib/python3.8/site-packages/mmdeploy/backend/sdk/export_info.py", line 61, in get_model_name_customs
task_processor = build_task_processor(
File "/opt/pyenv/versions/pytorch-1.8.1/lib/python3.8/site-packages/mmdeploy/apis/utils/utils.py", line 44, in build_task_processor
codebase_type = get_codebase(deploy_cfg, model_cfg=model_cfg)
File "/opt/pyenv/versions/pytorch-1.8.1/lib/python3.8/site-packages/mmdeploy/utils/config_utils.py", line 100, in get_codebase
or model_cfg['type'].startswith('mmrazor.'):
AttributeError: type object 'TopdownPoseEstimator' has no attribute 'startswith'
Additional information
1、通过mim(mim install mmpose)或者源码安装(python -m pip install .)的mmpose的目录(python3.8/site-packages/mmpose*)下面都没有configs这个文件夹,但是运行python tools/deploy.py会提示没有python3.8/site-packages/mmpose/configs/base/default_runtime.py这个文件,所以只能从源码中手动拷贝一个configs目录到python的安装目录
2、然后错误就变成另外一个错误AttributeError: type object 'TopdownPoseEstimator' has no attribute 'startswith'
3、已经尝试了通过mim安装mmengine、mmdeploy、mmpose或线上最新的代码安装,都会出现这个问题,而且只有转换rtmw-x这个模型的时候报错,其他的hrnet、faster_rcnn、rtmpose-m、rtmpose-x都可以正常运行
Prerequisite
Environment
pytorch:1.8.1+cu111 openmim:0.3.9 mmengine:0.9.0 mmcv:2.1.0 mmdeploy:1.3.0 mmpose:1.2.0 onnxruntime:1.8.1
Reproduces the problem - code sample
Reproduces the problem - command or script
Reproduces the problem - error message
错误1、 Traceback (most recent call last): File "tools/deploy.py", line 338, in
main()
File "tools/deploy.py", line 123, in main
deploy_cfg, model_cfg = load_config(deploy_cfg_path, model_cfg_path)
File "/opt/pyenv/versions/pytorch-1.8.1/lib/python3.8/site-packages/mmdeploy/utils/config_utils.py", line 29, in load_config
configs = [_load_config(cfg) for cfg in args]
File "/opt/pyenv/versions/pytorch-1.8.1/lib/python3.8/site-packages/mmdeploy/utils/config_utils.py", line 29, in
configs = [_load_config(cfg) for cfg in args]
File "/opt/pyenv/versions/pytorch-1.8.1/lib/python3.8/site-packages/mmdeploy/utils/config_utils.py", line 22, in _load_config
cfg = mmengine.Config.fromfile(cfg)
File "/opt/pyenv/versions/pytorch-1.8.1/lib/python3.8/site-packages/mmengine/config/config.py", line 490, in fromfile
raise e
File "/opt/pyenv/versions/pytorch-1.8.1/lib/python3.8/site-packages/mmengine/config/config.py", line 488, in fromfile
cfg_dict, imported_names = Config._parse_lazy_import(filename)
File "/opt/pyenv/versions/pytorch-1.8.1/lib/python3.8/site-packages/mmengine/config/config.py", line 1068, in _parse_lazy_import
raise ConfigParsingError(
mmengine.config.utils.ConfigParsingError: /opt/pyenv/versions/3.8.2/envs/pytorch-1.8.1/lib/python3.8/site-packages/mmpose/configs/base/default_runtime.py not found! It means that incorrect module is defined in
with read_base(): = from mmpose.configs._base_.default_runtime import ...
, please make sure the base config module is valid and is consistent with the prior import logic错误2、 Traceback (most recent call last): File "tools/deploy.py", line 338, in
main()
File "tools/deploy.py", line 129, in main
export2SDK(
File "/opt/pyenv/versions/pytorch-1.8.1/lib/python3.8/site-packages/mmdeploy/backend/sdk/export_info.py", line 352, in export2SDK
deploy_info = get_deploy(deploy_cfg, model_cfg, work_dir, device)
File "/opt/pyenv/versions/pytorch-1.8.1/lib/python3.8/site-packages/mmdeploy/backend/sdk/export_info.py", line 267, in getdeploy
, customs = get_model_name_customs(
File "/opt/pyenv/versions/pytorch-1.8.1/lib/python3.8/site-packages/mmdeploy/backend/sdk/export_info.py", line 61, in get_model_name_customs
task_processor = build_task_processor(
File "/opt/pyenv/versions/pytorch-1.8.1/lib/python3.8/site-packages/mmdeploy/apis/utils/utils.py", line 44, in build_task_processor
codebase_type = get_codebase(deploy_cfg, model_cfg=model_cfg)
File "/opt/pyenv/versions/pytorch-1.8.1/lib/python3.8/site-packages/mmdeploy/utils/config_utils.py", line 100, in get_codebase
or model_cfg['type'].startswith('mmrazor.'):
AttributeError: type object 'TopdownPoseEstimator' has no attribute 'startswith'
Additional information
1、通过mim(
mim install mmpose
)或者源码安装(python -m pip install .
)的mmpose的目录(python3.8/site-packages/mmpose*)下面都没有configs这个文件夹,但是运行python tools/deploy.py
会提示没有python3.8/site-packages/mmpose/configs/base/default_runtime.py这个文件,所以只能从源码中手动拷贝一个configs目录到python的安装目录 2、然后错误就变成另外一个错误AttributeError: type object 'TopdownPoseEstimator' has no attribute 'startswith' 3、已经尝试了通过mim安装mmengine、mmdeploy、mmpose或线上最新的代码安装,都会出现这个问题,而且只有转换rtmw-x这个模型的时候报错,其他的hrnet、faster_rcnn、rtmpose-m、rtmpose-x都可以正常运行