-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] (macOS) Linking problem? symbol not found in flat namespace '__ZN2at3mps9MPSStream6commitEb' #2951
Comments
Building from source: ~/openmmlab $ conda create --name openmmlab_2 python=3.8 -y (...) ca-certificates pkgs/main/osx-arm64::ca-certificates-2023.08.22-hca03da5_0 (...) ~/openmmlab $ conda activate openmmlab_2 (...) The following packages will be downloaded:
The following NEW packages will be INSTALLED: blas pkgs/main/osx-arm64::blas-1.0-openblas (...) ~/openmmlab $ python -c 'import torch;print(torch.version)' (openmmlab_2) (…) building output omitted. Only warnings are like: ld: warning: object file (/Users/madcode/openmmlab/mmcv/build/temp.macosx-11.1-arm64-cpython-38/mmcv/ops/csrc/pytorch/voxelization.o) was built for newer 'macOS' version (13.0) than being linked (11.1)
Successfully installed addict-2.4.0 contourpy-1.1.1 cycler-0.12.0 fonttools-4.43.0 importlib-metadata-6.8.0 importlib-resources-6.1.0 kiwisolver-1.4.5 markdown-it-py-3.0.0 matplotlib-3.7.3 mdurl-0.1.2 mmcv-2.0.1 mmengine-0.8.5 opencv-python-4.8.1.78 packaging-23.2 platformdirs-3.11.0 pygments-2.16.1 pyparsing-3.1.1 python-dateutil-2.8.2 rich-13.6.0 six-1.16.0 termcolor-2.3.0 tomli-2.0.1 yapf-0.40.2 zipp-3.17.0 ~/o/mmcv (main|✔) $ python .dev_scripts/check_installation.py (openmmlab_2) |
Hi @debugmenot , as a workaround, you can pull the main branch to fix this error (#2958) or downgrade your torch to 2.0.0 and we will fix this error for 2.1.0 in the future. |
Hi! Any schedule to return back MPS support? 2.1.0 is already released but MPS is disabled :( There are lots of new MPS functions supported in Torch 2.1... |
Hi @debugmenot, the support for MPS backend is in our schedule but with a not high priority. By the way, you can still use the op supported in torch. |
@debugmenot |
2.0.0, still don't work |
+1 |
When I use mmcv 2.0.x it failed. But after changing to both using mmcv 2.1.0 and torch 2.0.x it get fixed. |
I fixed this by downgrading |
Prerequisite
Environment
MacOS 13.6 (Same issue on 14.0 Sonoma)
Apple Silicon M1 Ultra / 64G
PyTorch 2.1 (release)
Impossible to get info from mmcv because of symbol not found error.
Reproduces the problem - code sample
Installed by official instructions.
If building MMCV from source with PyTorch 2.1 problem still exists...
There are no such issues with PyTorch 2.0
Reproduces the problem - command or script
~/o/mmdetection (main|✔) $ mim download mmdet --config rtmdet_tiny_8xb32-300e_coco --dest . (openmmlab)
processing rtmdet_tiny_8xb32-300e_coco...
downloading ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 54.9/54.9 MiB 851.5 kB/s eta 0:00:00
Successfully downloaded rtmdet_tiny_8xb32-300e_coco_20220902_112414-78e30dcc.pth to /Users/madcode/openmmlab/mmdetection
Successfully dumped rtmdet_tiny_8xb32-300e_coco.py to /Users/madcode/openmmlab/mmdetection
~/o/mmdetection (main|✔) $ python demo/image_demo.py demo/demo.jpg rtmdet_tiny_8xb32-300e_coco.py --weights rtmdet_tiny_8xb32-300e_coco_20220902_112414-78e30dcc.pth --device cpu
Reproduces the problem - error message
~/o/mmdetection (main|✔) $ mim download mmdet --config rtmdet_tiny_8xb32-300e_coco --dest . (openmmlab)
processing rtmdet_tiny_8xb32-300e_coco...
downloading ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 54.9/54.9 MiB 851.5 kB/s eta 0:00:00
Successfully downloaded rtmdet_tiny_8xb32-300e_coco_20220902_112414-78e30dcc.pth to /Users/madcode/openmmlab/mmdetection
Successfully dumped rtmdet_tiny_8xb32-300e_coco.py to /Users/madcode/openmmlab/mmdetection
~/o/mmdetection (main|✔) $ python demo/image_demo.py demo/demo.jpg rtmdet_tiny_8xb32-300e_coco.py --weights rtmdet_tiny_8xb32-300e_coco_20220902_112414-78e30dcc.pth --device cpu
Traceback (most recent call last):
File "demo/image_demo.py", line 43, in
from mmdet.apis import DetInferencer
File "/Users/madcode/openmmlab/mmdetection/mmdet/apis/init.py", line 2, in
from .det_inferencer import DetInferencer
File "/Users/madcode/openmmlab/mmdetection/mmdet/apis/det_inferencer.py", line 21, in
from mmdet.evaluation import INSTANCE_OFFSET
File "/Users/madcode/openmmlab/mmdetection/mmdet/evaluation/init.py", line 3, in
from .metrics import * # noqa: F401,F403
File "/Users/madcode/openmmlab/mmdetection/mmdet/evaluation/metrics/init.py", line 5, in
from .coco_metric import CocoMetric
File "/Users/madcode/openmmlab/mmdetection/mmdet/evaluation/metrics/coco_metric.py", line 16, in
from mmdet.datasets.api_wrappers import COCO, COCOeval
File "/Users/madcode/openmmlab/mmdetection/mmdet/datasets/init.py", line 26, in
from .utils import get_loading_pipeline
File "/Users/madcode/openmmlab/mmdetection/mmdet/datasets/utils.py", line 5, in
from mmdet.datasets.transforms import LoadAnnotations, LoadPanopticAnnotations
File "/Users/madcode/openmmlab/mmdetection/mmdet/datasets/transforms/init.py", line 6, in
from .formatting import (ImageToTensor, PackDetInputs, PackReIDInputs,
File "/Users/madcode/openmmlab/mmdetection/mmdet/datasets/transforms/formatting.py", line 11, in
from mmdet.structures.bbox import BaseBoxes
File "/Users/madcode/openmmlab/mmdetection/mmdet/structures/bbox/init.py", line 2, in
from .base_boxes import BaseBoxes
File "/Users/madcode/openmmlab/mmdetection/mmdet/structures/bbox/base_boxes.py", line 9, in
from mmdet.structures.mask.structures import BitmapMasks, PolygonMasks
File "/Users/madcode/openmmlab/mmdetection/mmdet/structures/mask/init.py", line 3, in
from .structures import (BaseInstanceMasks, BitmapMasks, PolygonMasks,
File "/Users/madcode/openmmlab/mmdetection/mmdet/structures/mask/structures.py", line 12, in
from mmcv.ops.roi_align import roi_align
File "/opt/homebrew/Caskroom/miniconda/base/envs/openmmlab/lib/python3.8/site-packages/mmcv/ops/init.py", line 2, in
from .active_rotated_filter import active_rotated_filter
File "/opt/homebrew/Caskroom/miniconda/base/envs/openmmlab/lib/python3.8/site-packages/mmcv/ops/active_rotated_filter.py", line 10, in
ext_module = ext_loader.load_ext(
File "/opt/homebrew/Caskroom/miniconda/base/envs/openmmlab/lib/python3.8/site-packages/mmcv/utils/ext_loader.py", line 13, in load_ext
ext = importlib.import_module('mmcv.' + name)
File "/opt/homebrew/Caskroom/miniconda/base/envs/openmmlab/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: dlopen(/opt/homebrew/Caskroom/miniconda/base/envs/openmmlab/lib/python3.8/site-packages/mmcv/_ext.cpython-38-darwin.so, 0x0002): symbol not found in flat namespace '__ZN2at3mps9MPSStream6commitEb'
Additional information
No response
The text was updated successfully, but these errors were encountered: