mmcv icon indicating copy to clipboard operation
mmcv copied to clipboard

[Bug] ImportError: dlopen(/opt/homebrew/anaconda3/envs/vis/lib/python3.8/site-packages/mmcv/_ext.cpython-38-darwin.so, 0x0002): symbol not found in flat namespace '__ZN2at3mps9MPSStream6commitEb'

Open LeiChen9 opened this issue 1 year ago • 4 comments

Prerequisite

  • [X] I have searched Issues and Discussions but cannot get the expected help.
  • [X] The bug has not been fixed in the latest version(https://github.com/open-mmlab/mmcv).

Environment

Trace like: Traceback (most recent call last): File "demo/topdown_demo_with_mmdet.py", line 15, in from mmpose.apis import inference_topdown File "/Users/lei/Documents/Code/mmpose/mmpose/apis/init.py", line 2, in from .inference import (collect_multi_frames, inference_bottomup, File "/Users/lei/Documents/Code/mmpose/mmpose/apis/inference.py", line 17, in from mmpose.models.builder import build_pose_estimator File "/Users/lei/Documents/Code/mmpose/mmpose/models/init.py", line 8, in from .heads import * # noqa File "/Users/lei/Documents/Code/mmpose/mmpose/models/heads/init.py", line 11, in from .transformer_heads import EDPoseHead File "/Users/lei/Documents/Code/mmpose/mmpose/models/heads/transformer_heads/init.py", line 2, in from .edpose_head import EDPoseHead File "/Users/lei/Documents/Code/mmpose/mmpose/models/heads/transformer_heads/edpose_head.py", line 14, in from mmcv.ops import MultiScaleDeformableAttention File "/opt/homebrew/anaconda3/envs/vis/lib/python3.8/site-packages/mmcv/ops/init.py", line 2, in from .active_rotated_filter import active_rotated_filter File "/opt/homebrew/anaconda3/envs/vis/lib/python3.8/site-packages/mmcv/ops/active_rotated_filter.py", line 10, in ext_module = ext_loader.load_ext( File "/opt/homebrew/anaconda3/envs/vis/lib/python3.8/site-packages/mmcv/utils/ext_loader.py", line 13, in load_ext ext = importlib.import_module('mmcv.' + name) File "/opt/homebrew/anaconda3/envs/vis/lib/python3.8/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) ImportError: dlopen(/opt/homebrew/anaconda3/envs/vis/lib/python3.8/site-packages/mmcv/_ext.cpython-38-darwin.so, 0x0002): symbol not found in flat namespace '__ZN2at3mps9MPSStream6commitEb'

Reproduces the problem - code sample

https://mmpose.readthedocs.io/zh-cn/latest/installation.html

Reproduces the problem - command or script

python demo/topdown_demo_with_mmdet.py
demo/mmdetection_cfg/rtmdet_m_8xb32-300e_coco.py
https://download.openmmlab.com/mmdetection/v3.0/rtmdet/rtmdet_m_8xb32-300e_coco/rtmdet_m_8xb32-300e_coco_20220719_112220-229f527c.pth
configs/animal_2d_keypoint/topdown_heatmap/animalpose/td-hm_hrnet-w32_8xb64-210e_animalpose-256x256.py \ https://download.openmmlab.com/mmpose/animal/hrnet/hrnet_w32_animalpose_256x256-1aa7f075_20210426.pth
--input tests/data/animalpose/ca110.jpeg
--show --draw-heatmap --det-cat-id=15

Reproduces the problem - error message

/opt/homebrew/anaconda3/envs/vis/lib/python3.8/site-packages/mmengine/optim/optimizer/zero_optimizer.py:11: DeprecationWarning: TorchScript support for functional optimizers is deprecated and will be removed in a future PyTorch release. Consider using the torch.compile optimizer instead. from torch.distributed.optim import
/opt/homebrew/anaconda3/envs/vis/lib/python3.8/site-packages/mmcv/cnn/bricks/transformer.py:33: UserWarning: Fail to import MultiScaleDeformableAttention from mmcv.ops.multi_scale_deform_attn, You should install mmcv rather than mmcv-lite if you need this module. warnings.warn('Fail to import MultiScaleDeformableAttention from ' Traceback (most recent call last): File "demo/topdown_demo_with_mmdet.py", line 15, in from mmpose.apis import inference_topdown File "/Users/lei/Documents/Code/mmpose/mmpose/apis/init.py", line 2, in from .inference import (collect_multi_frames, inference_bottomup, File "/Users/lei/Documents/Code/mmpose/mmpose/apis/inference.py", line 17, in from mmpose.models.builder import build_pose_estimator File "/Users/lei/Documents/Code/mmpose/mmpose/models/init.py", line 8, in from .heads import * # noqa File "/Users/lei/Documents/Code/mmpose/mmpose/models/heads/init.py", line 11, in from .transformer_heads import EDPoseHead File "/Users/lei/Documents/Code/mmpose/mmpose/models/heads/transformer_heads/init.py", line 2, in from .edpose_head import EDPoseHead File "/Users/lei/Documents/Code/mmpose/mmpose/models/heads/transformer_heads/edpose_head.py", line 14, in from mmcv.ops import MultiScaleDeformableAttention File "/opt/homebrew/anaconda3/envs/vis/lib/python3.8/site-packages/mmcv/ops/init.py", line 2, in from .active_rotated_filter import active_rotated_filter File "/opt/homebrew/anaconda3/envs/vis/lib/python3.8/site-packages/mmcv/ops/active_rotated_filter.py", line 10, in ext_module = ext_loader.load_ext( File "/opt/homebrew/anaconda3/envs/vis/lib/python3.8/site-packages/mmcv/utils/ext_loader.py", line 13, in load_ext ext = importlib.import_module('mmcv.' + name) File "/opt/homebrew/anaconda3/envs/vis/lib/python3.8/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) ImportError: dlopen(/opt/homebrew/anaconda3/envs/vis/lib/python3.8/site-packages/mmcv/_ext.cpython-38-darwin.so, 0x0002): symbol not found in flat namespace '__ZN2at3mps9MPSStream6commitEb'

Additional information

No response

LeiChen9 avatar Aug 07 '24 10:08 LeiChen9

I encountered the same problem after adjusting the version of mmcv from 2.2.0 to 2.2.0rc4. My device is mac air m1. I solved the problem by adjusting the version of mmcv to 2.1.0. pip uninstall mmcv mmcv install mmcv==2.1.0

yxizhong avatar Sep 28 '24 09:09 yxizhong

@yxizhong What is your mmdet version? Thank you!

guotong1988 avatar Dec 26 '24 03:12 guotong1988

@yxizhong What is your mmdet version? Thank you!

3.3.0

yxizhong avatar Dec 31 '24 13:12 yxizhong

@yxizhong My device is mac pro m1。 mmcv==2.1.0 mmdet==3.3.0 But this error occurs. How can I solve it?Thank you! 【 File "/opt/anaconda3/envs/gis_detection3d/lib/python3.10/site-packages/torch/cuda/init.py", line 310, in _lazy_init raise AssertionError("Torch not compiled with CUDA enabled") AssertionError: Torch not compiled with CUDA enabled】

ChengWuOne avatar Jan 16 '25 06:01 ChengWuOne