def load_ext(name, funcs):
import pdb;pdb.set_trace()
ext = importlib.import_module('mmcv.' + name)
for fun in funcs:
assert hasattr(ext, fun), f'{fun} miss in module {name}'
return ext
Traceback (most recent call last):
File "/usr/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/usr/lib/python3.10/multiprocessing/process.py", line 108, in run
self._target(*self._args, *self._kwargs)
File "/usr/local/lib/python3.10/dist-packages/mmdeploy/apis/core/pipeline_manager.py", line 107, in call
ret = func(args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/mmdeploy/apis/pytorch2onnx.py", line 63, in torch2onnx
torch_model = task_processor.build_pytorch_model(model_checkpoint)
File "/usr/local/lib/python3.10/dist-packages/mmdeploy/codebase/base/task.py", line 125, in build_pytorch_model
model = revert_sync_batchnorm(model)
File "/usr/local/lib/python3.10/dist-packages/mmengine/model/utils.py", line 174, in revert_sync_batchnorm
from mmcv.ops import SyncBatchNorm
File "/usr/local/lib/python3.10/dist-packages/mmcv/ops/init.py", line 3, in
from .active_rotated_filter import active_rotated_filter
File "/usr/local/lib/python3.10/dist-packages/mmcv/ops/active_rotated_filter.py", line 10, in
ext_module = ext_loader.load_ext(
File "/usr/local/lib/python3.10/dist-packages/mmcv/utils/ext_loader.py", line 13, in load_ext
ext = importlib.import_module('mmcv.' + name)
File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: /usr/local/lib/python3.10/dist-packages/mmcv/_ext.cpython-310-x86_64-linux-gnu.so: undefined symbol: _ZN2at4_ops10zeros_like4callERKNS_6TensorEN3c108optionalINS5_10ScalarTypeEEENS6_INS5_6LayoutEEENS6_INS5_6DeviceEEENS6_IbEENS6_INS5_12MemoryFormatEEE
08/14 21:26:05 - mmengine - ERROR - /usr/local/lib/python3.10/dist-packages/mmdeploy/apis/core/pipeline_manager.py - pop_mp_output - 80 - mmdeploy.apis.pytorch2onnx.torch2onnx with Call id: 0 failed. exit.
root@yq01-sys-hic-k8s-v100-box-a225-0426.yq01.baidu.com bmat $ bash export_classification.sh
/usr/lib/python3/dist-packages/requests/init.py:89: RequestsDependencyWarning: urllib3 (2.0.7) or chardet (3.0.4) doesn't match a supported version!
warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "
Prerequisite
Environment
pip3 install torch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 --index-url https://download.pytorch.org/whl/cu118 && \ pip3 install onnxruntime-gpu==1.16.0 && \ pip3 install onnx==1.16.1 pip3 install mmcv==2.1.0 -f https://download.openmmlab.com/mmcv/dist/cu118/torch2.2/index.html && \ pip3 install mmdet==3.2.0 && \ pip3 install mmpretrain==1.2.0 && \ pip3 install mmengine && \ pip3 install mmdeploy==1.2.0 && \ pip3 install mmdeploy-runtime-gpu==1.2.0
Reproduces the problem - code sample
if torch.version != 'parrots':
Reproduces the problem - command or script
python mmdeploy/tools/deploy.py \ mmdeploy/configs/mmpretrain/classification_onnxruntime_dynamic.py \ mmpretrain/configs/resnet/resnet50_8xb32_in1k.py \ resnet50_8xb32_in1k_20210831-ea4938fc.pth \ demo.jpg \ --work-dir work_dirs/onnx \ --device cpu \ --dump-info
Reproduces the problem - error message
Traceback (most recent call last): File "/usr/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/usr/lib/python3.10/multiprocessing/process.py", line 108, in run self._target(*self._args, *self._kwargs) File "/usr/local/lib/python3.10/dist-packages/mmdeploy/apis/core/pipeline_manager.py", line 107, in call ret = func(args, **kwargs) File "/usr/local/lib/python3.10/dist-packages/mmdeploy/apis/pytorch2onnx.py", line 63, in torch2onnx torch_model = task_processor.build_pytorch_model(model_checkpoint) File "/usr/local/lib/python3.10/dist-packages/mmdeploy/codebase/base/task.py", line 125, in build_pytorch_model model = revert_sync_batchnorm(model) File "/usr/local/lib/python3.10/dist-packages/mmengine/model/utils.py", line 174, in revert_sync_batchnorm from mmcv.ops import SyncBatchNorm File "/usr/local/lib/python3.10/dist-packages/mmcv/ops/init.py", line 3, in
from .active_rotated_filter import active_rotated_filter
File "/usr/local/lib/python3.10/dist-packages/mmcv/ops/active_rotated_filter.py", line 10, in
ext_module = ext_loader.load_ext(
File "/usr/local/lib/python3.10/dist-packages/mmcv/utils/ext_loader.py", line 13, in load_ext
ext = importlib.import_module('mmcv.' + name)
File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: /usr/local/lib/python3.10/dist-packages/mmcv/_ext.cpython-310-x86_64-linux-gnu.so: undefined symbol: _ZN2at4_ops10zeros_like4callERKNS_6TensorEN3c108optionalINS5_10ScalarTypeEEENS6_INS5_6LayoutEEENS6_INS5_6DeviceEEENS6_IbEENS6_INS5_12MemoryFormatEEE
08/14 21:26:05 - mmengine - ERROR - /usr/local/lib/python3.10/dist-packages/mmdeploy/apis/core/pipeline_manager.py - pop_mp_output - 80 -
mmdeploy.apis.pytorch2onnx.torch2onnx
with Call id: 0 failed. exit. root@yq01-sys-hic-k8s-v100-box-a225-0426.yq01.baidu.com bmat $ bash export_classification.sh /usr/lib/python3/dist-packages/requests/init.py:89: RequestsDependencyWarning: urllib3 (2.0.7) or chardet (3.0.4) doesn't match a supported version! warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "Additional information
No response