openxrlab / xrmocap

OpenXRLab Multi-view Motion Capture Toolbox and Benchmark

Home Page:https://xrmocap.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NameError: name 'init_pose_model' is not defined

dwygs opened this issue · comments

commented

你好,我在测试时候出现这样的错误
image
执行的命令:python tools/run_mview_sperson_estimator.py ...
排查发现是安装的mmpose.api 目录没有 ‘init_pose_model ’ 脚本,不知道是不是各安装包版本不兼容,想请教一下解决方法
各安装包版本:
mmcv-full ==1.6.0
mmdet ==2.28.2
mmpose ==0.29.0
mmtrack ==0.14.0
xrmocap ==0.8.0
xrprimer ==0.7.0

Hi @dwygs, welcome to commit your first issue!
你好 @dwygs,非常欢迎首次提交你的问题!

在测试中我们使用了:
numpy==1.23.5
scipy==1.10.0
mmcv-full==1.6.1
mmdet==2.27.0
mmpose==0.29.0
xrmocap==0.8.0
xrprimer==0.7.0
因为安装包版本要求严格,在v0.8.0版本之后我们不再默认安装mmtrack,如果需要安装,请参考v0.8.0之前的发布历史。
另外,本人测试以下版本也可用:
numpy==1.22.4
scipy==1.7.3
mmcv-full==1.5.3
mmdet==2.25.1
mmpose==0.28.1
mmtrack==0.14.0
xrmocap==0.8.0
xrprimer==0.7.0

check out the code around this import:
https://github.com/openxrlab/xrmocap/blob/main/xrmocap/human_perception/keypoints_estimation/mmpose_top_down_estimator.py#L11-L17

try:
    from mmcv import digit_version
    from mmpose import __version__ as mmpose_version
    from mmpose.apis import inference_top_down_pose_model, init_pose_model
    has_mmpose = True
    import_exception = ''
except (ImportError, ModuleNotFoundError):

there is a try-except around the function import for init_pose_model.
i fixed this problem for me by manually setting a breakpoint and checking out which of the imports caused the exception.