Skip to content
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] can't run with mac(M1) #2070

Open
2 tasks done
Joker1212 opened this issue Nov 20, 2024 · 0 comments
Open
2 tasks done

[Bug] can't run with mac(M1) #2070

Joker1212 opened this issue Nov 20, 2024 · 0 comments
Assignees

Comments

@Joker1212
Copy link

Prerequisite

Task

I'm using the official example scripts/configs for the officially supported tasks/models/datasets.

Branch

main branch https://github.com/open-mmlab/mmocr

Environment

sys.platform: darwin
Python: 3.10.15 (main, Oct 3 2024, 02:24:49) [Clang 14.0.6 ]
CUDA available: False
MUSA available: False
numpy_random_seed: 2147483648
GCC: Apple clang version 15.0.0 (clang-1500.3.9.4)
PyTorch: 2.0.0
PyTorch compiling details: PyTorch built with:

  • GCC 4.2
  • C++ Version: 201703
  • clang 13.1.6
  • LAPACK is enabled (usually provided by MKL)
  • NNPACK is enabled
  • CPU capability usage: NO AVX
  • Build settings: BLAS_INFO=accelerate, BUILD_TYPE=Release, CXX_COMPILER=/Applications/Xcode_13.3.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -Wno-deprecated-declarations -DUSE_PTHREADPOOL -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOCUPTI -DLIBKINETO_NOROCTRACER -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DUSE_PYTORCH_METAL_EXPORT -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DUSE_COREML_DELEGATE -O2 -fPIC -Wall -Wextra -Werror=return-type -Werror=non-virtual-dtor -Werror=braced-scalar-init -Werror=range-loop-construct -Werror=bool-operation -Winconsistent-missing-override -Wnarrowing -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wunused-local-typedefs -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wvla-extension -Wno-range-loop-analysis -Wno-pass-failed -Wsuggest-override -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -Wconstant-conversion -Wno-invalid-partial-specialization -Wno-typedef-redefinition -Wno-unused-private-field -Wno-inconsistent-missing-override -Wno-constexpr-not-const -Wno-missing-braces -Wunused-lambda-capture -Wunused-local-typedef -Qunused-arguments -fcolor-diagnostics -fdiagnostics-color=always -fno-math-errno -fno-trapping-math -Werror=format -Werror=cast-function-type -DUSE_MPS -fno-objc-arc -Wno-unguarded-availability-new -Wno-unused-private-field -Wno-missing-braces -Wno-constexpr-not-const, LAPACK_INFO=accelerate, TORCH_DISABLE_GPU_ASSERTS=OFF, TORCH_VERSION=2.0.0, USE_CUDA=OFF, USE_CUDNN=OFF, USE_EIGEN_FOR_BLAS=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=OFF, USE_MKLDNN=OFF, USE_MPI=OFF, USE_NCCL=OFF, USE_NNPACK=ON, USE_OPENMP=OFF, USE_ROCM=OFF,

TorchVision: 0.15.0
OpenCV: 4.10.0
MMEngine: 0.10.5
MMOCR: 1.0.1+

Reproduces the problem - code sample

from mmocr.apis import MMOCRInferencer
import matplotlib.pyplot as plt

if name == 'main':
infer = MMOCRInferencer(det='dbnetpp', rec='crnn',device="cpu")
img_path = "images/bad2.png"
result = infer('img_path', return_vis=True)
plt.figure(figsize=(9, 16))
plt.imshow(result['visualization'][0])
plt.show()

Reproduces the problem - command or script

from mmocr.apis import MMOCRInferencer
import matplotlib.pyplot as plt

if name == 'main':
infer = MMOCRInferencer(det='dbnetpp', rec='crnn',device="cpu")
img_path = "images/bad2.png"
result = infer('img_path', return_vis=True)
plt.figure(figsize=(9, 16))
plt.imshow(result['visualization'][0])
plt.show()

Reproduces the problem - error message

Traceback (most recent call last):
File "/Users/macbookc23551/PycharmProjects/mmocr/main.py", line 5, in
infer = MMOCRInferencer(det='dbnetpp', rec='crnn',device="cpu")
File "/opt/miniconda3/envs/mmocr/lib/python3.10/site-packages/mmocr/apis/inferencers/mmocr_inferencer.py", line 69, in init
self.textdet_inferencer = TextDetInferencer(
File "/opt/miniconda3/envs/mmocr/lib/python3.10/site-packages/mmocr/apis/inferencers/base_mmocr_inferencer.py", line 65, in init
super().init(
File "/opt/miniconda3/envs/mmocr/lib/python3.10/site-packages/mmengine/infer/infer.py", line 180, in init
self.model = self._init_model(cfg, weights, device) # type: ignore
File "/opt/miniconda3/envs/mmocr/lib/python3.10/site-packages/mmengine/infer/infer.py", line 483, in _init_model
model = MODELS.build(cfg.model)
File "/opt/miniconda3/envs/mmocr/lib/python3.10/site-packages/mmengine/registry/registry.py", line 570, in build
return self.build_func(cfg, *args, **kwargs, registry=self)
File "/opt/miniconda3/envs/mmocr/lib/python3.10/site-packages/mmengine/registry/build_functions.py", line 232, in build_model_from_cfg
return build_from_cfg(cfg, registry, default_args)
File "/opt/miniconda3/envs/mmocr/lib/python3.10/site-packages/mmengine/registry/build_functions.py", line 98, in build_from_cfg
obj_cls = registry.get(obj_type)
File "/opt/miniconda3/envs/mmocr/lib/python3.10/site-packages/mmengine/registry/registry.py", line 451, in get
self.import_from_location()
File "/opt/miniconda3/envs/mmocr/lib/python3.10/site-packages/mmengine/registry/registry.py", line 376, in import_from_location
import_module(loc)
File "/opt/miniconda3/envs/mmocr/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/opt/miniconda3/envs/mmocr/lib/python3.10/site-packages/mmocr/models/init.py", line 2, in
from .common import * # NOQA
File "/opt/miniconda3/envs/mmocr/lib/python3.10/site-packages/mmocr/models/common/init.py", line 2, in
from .backbones import * # NOQA
File "/opt/miniconda3/envs/mmocr/lib/python3.10/site-packages/mmocr/models/common/backbones/init.py", line 2, in
from .clip_resnet import CLIPResNet
File "/opt/miniconda3/envs/mmocr/lib/python3.10/site-packages/mmocr/models/common/backbones/clip_resnet.py", line 4, in
from mmdet.models.backbones import ResNet
File "/opt/miniconda3/envs/mmocr/lib/python3.10/site-packages/mmdet/models/init.py", line 2, in
from .backbones import * # noqa: F401,F403
File "/opt/miniconda3/envs/mmocr/lib/python3.10/site-packages/mmdet/models/backbones/init.py", line 2, in
from .csp_darknet import CSPDarknet
File "/opt/miniconda3/envs/mmocr/lib/python3.10/site-packages/mmdet/models/backbones/csp_darknet.py", line 11, in
from ..layers import CSPLayer
File "/opt/miniconda3/envs/mmocr/lib/python3.10/site-packages/mmdet/models/layers/init.py", line 3, in
from .bbox_nms import fast_nms, multiclass_nms
File "/opt/miniconda3/envs/mmocr/lib/python3.10/site-packages/mmdet/models/layers/bbox_nms.py", line 5, in
from mmcv.ops.nms import batched_nms
File "/opt/miniconda3/envs/mmocr/lib/python3.10/site-packages/mmcv/ops/init.py", line 2, in
from .active_rotated_filter import active_rotated_filter
File "/opt/miniconda3/envs/mmocr/lib/python3.10/site-packages/mmcv/ops/active_rotated_filter.py", line 10, in
ext_module = ext_loader.load_ext(
File "/opt/miniconda3/envs/mmocr/lib/python3.10/site-packages/mmcv/utils/ext_loader.py", line 13, in load_ext
ext = importlib.import_module('mmcv.' + name)
File "/opt/miniconda3/envs/mmocr/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: dlopen(/opt/miniconda3/envs/mmocr/lib/python3.10/site-packages/mmcv/_ext.cpython-310-darwin.so, 0x0002): Symbol not found: __ZNK3c105Error4whatEv
Referenced from: <7C1A4097-6119-3DEF-8A7A-6BB83B78C991> /opt/miniconda3/envs/mmocr/lib/python3.10/site-packages/mmcv/_ext.cpython-310-darwin.so
Expected in: <3F9923D2-81A5-3EC8-9739-EC0C1C816132> /opt/miniconda3/envs/mmocr/lib/python3.10/site-packages/torch/lib/libc10.dylib

Additional information

I just use the official demo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants