open-mmlab / mmdeploy

OpenMMLab Model Deployment Framework
https://mmdeploy.readthedocs.io/en/latest/
Apache License 2.0
2.79k stars 637 forks source link

[Bug] centerpoint to onnx #2373

Closed DavidZah closed 1 year ago

DavidZah commented 1 year ago

Checklist

Describe the bug

Am not able to export centerpoint model from https://mmdeploy.readthedocs.io/en/latest/04-supported-codebases/mmdet3d.html. I try diferent versions. Thx for help

Reproduction

python tools/deploy.py configs/mmdet3d/voxel-detection/voxel-detection_onnxruntime_dynamic.py configs/centerpoint/centerpoint_pillar02_second_secfpn_head-circlenms_8xb4-cyclic-20e_nus-3d.py mmdet3d/centerpoint_02pillar_second_secfpn_circlenms_4x8_cyclic_20e_nus_20220811_031844-191a3822.pth mmdet3d/v1.0-mini/sweeps/LIDAR_TOP/n008-2018-08-01-15-16-36-0400__LIDAR_TOP__1533151603747767.pcd.bin --work-dir centerpoint

Environment

08/24 10:30:41 - mmengine - INFO - 

08/24 10:30:41 - mmengine - INFO - **********Environmental information**********
08/24 10:30:41 - mmengine - INFO - sys.platform: linux
08/24 10:30:41 - mmengine - INFO - Python: 3.8.17 (default, Jul  5 2023, 21:04:15) [GCC 11.2.0]
08/24 10:30:41 - mmengine - INFO - CUDA available: True
08/24 10:30:41 - mmengine - INFO - numpy_random_seed: 2147483648
08/24 10:30:41 - mmengine - INFO - GPU 0: NVIDIA GeForce RTX 3070
08/24 10:30:41 - mmengine - INFO - CUDA_HOME: /usr
08/24 10:30:41 - mmengine - INFO - NVCC: Cuda compilation tools, release 11.5, V11.5.119
08/24 10:30:41 - mmengine - INFO - GCC: gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
08/24 10:30:41 - mmengine - INFO - PyTorch: 1.10.1
08/24 10:30:41 - mmengine - INFO - PyTorch compiling details: PyTorch built with:
  - GCC 7.3
  - C++ Version: 201402
  - Intel(R) oneAPI Math Kernel Library Version 2021.4-Product Build 20210904 for Intel(R) 64 architecture applications
  - Intel(R) MKL-DNN v2.2.3 (Git Hash 7336ca9f055cf1bfa13efb658fe15dc9b41f0740)
  - OpenMP 201511 (a.k.a. OpenMP 4.5)
  - LAPACK is enabled (usually provided by MKL)
  - NNPACK is enabled
  - CPU capability usage: AVX2
  - CUDA Runtime 11.3
  - NVCC architecture flags: -gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_80,code=sm_80;-gencode;arch=compute_86,code=sm_86;-gencode;arch=compute_37,code=compute_37
  - CuDNN 8.2
  - Magma 2.5.2
  - Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=11.3, CUDNN_VERSION=8.2.0, CXX_COMPILER=/opt/rh/devtoolset-7/root/usr/bin/c++, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_VERSION=1.10.1, USE_CUDA=ON, USE_CUDNN=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON, 

08/24 10:30:41 - mmengine - INFO - TorchVision: 0.11.2
08/24 10:30:41 - mmengine - INFO - OpenCV: 4.8.0
08/24 10:30:41 - mmengine - INFO - MMEngine: 0.8.4
08/24 10:30:41 - mmengine - INFO - MMCV: 2.0.0
08/24 10:30:41 - mmengine - INFO - MMCV Compiler: GCC 9.3
08/24 10:30:41 - mmengine - INFO - MMCV CUDA Compiler: 11.3
08/24 10:30:41 - mmengine - INFO - MMDeploy: 1.2.0+a7e9be2
08/24 10:30:41 - mmengine - INFO - 

08/24 10:30:41 - mmengine - INFO - **********Backend information**********
08/24 10:30:41 - mmengine - INFO - tensorrt:    None
08/24 10:30:41 - mmengine - INFO - ONNXRuntime: 1.8.1
08/24 10:30:41 - mmengine - INFO - ONNXRuntime-gpu:     None
08/24 10:30:41 - mmengine - INFO - ONNXRuntime custom ops:      Available
08/24 10:30:41 - mmengine - INFO - pplnn:       None
08/24 10:30:41 - mmengine - INFO - ncnn:        None
08/24 10:30:41 - mmengine - INFO - snpe:        None
08/24 10:30:41 - mmengine - INFO - openvino:    2023.0.1
08/24 10:30:41 - mmengine - INFO - torchscript: 1.10.1
08/24 10:30:41 - mmengine - INFO - torchscript custom ops:      NotAvailable
08/24 10:30:41 - mmengine - INFO - rknn-toolkit:        None
08/24 10:30:41 - mmengine - INFO - rknn-toolkit2:       None
08/24 10:30:41 - mmengine - INFO - ascend:      None
08/24 10:30:41 - mmengine - INFO - coreml:      None
08/24 10:30:41 - mmengine - INFO - tvm: None
08/24 10:30:41 - mmengine - INFO - vacc:        None
08/24 10:30:41 - mmengine - INFO - 

08/24 10:30:41 - mmengine - INFO - **********Codebase information**********
08/24 10:30:41 - mmengine - INFO - mmdet:       3.0.0
08/24 10:30:41 - mmengine - INFO - mmseg:       None
08/24 10:30:41 - mmengine - INFO - mmpretrain:  None
08/24 10:30:41 - mmengine - INFO - mmocr:       None
08/24 10:30:41 - mmengine - INFO - mmagic:      None
08/24 10:30:41 - mmengine - INFO - mmdet3d:     1.1.0
08/24 10:30:41 - mmengine - INFO - mmpose:      None
08/24 10:30:41 - mmengine - INFO - mmrotate:    None
08/24 10:30:41 - mmengine - INFO - mmaction:    None
08/24 10:30:41 - mmengine - INFO - mmrazor:     None
08/24 10:30:41 - mmengine - INFO - mmyolo:      None

absl-py                   1.4.0
addict                    2.4.0
aenum                     3.1.15
aliyun-python-sdk-core    2.13.36
aliyun-python-sdk-kms     2.16.1
ansi2html                 1.8.0
anyio                     3.7.1
argon2-cffi               23.1.0
argon2-cffi-bindings      21.2.0
arrow                     1.2.3
asttokens                 2.2.1
async-lru                 2.0.4
attrs                     23.1.0
Babel                     2.12.1
backcall                  0.2.0
beautifulsoup4            4.12.2
black                     23.7.0
bleach                    6.0.0
cachetools                5.3.1
certifi                   2023.7.22
cffi                      1.15.1
charset-normalizer        2.0.12
click                     8.1.6
colorama                  0.4.6
comm                      0.1.4
ConfigArgParse            1.7
contourpy                 1.1.0
crcmod                    1.7
cryptography              41.0.3
cycler                    0.11.0
dash                      2.12.1
dash-core-components      2.0.0
dash-html-components      2.0.0
dash-table                5.0.0
debugpy                   1.6.7.post1
decorator                 5.1.1
defusedxml                0.7.1
depthai                   2.21.2.0
depthai-sdk               1.9.4
descartes                 1.1.0
dill                      0.3.7
distinctipy               1.2.2
exceptiongroup            1.1.3
executing                 1.2.0
fastjsonschema            2.18.0
ffmpy3                    0.2.4
fire                      0.5.0
flake8                    6.1.0
Flask                     2.2.5
flatbuffers               23.5.26
fonttools                 4.42.1
fqdn                      1.5.1
google-auth               2.22.0
google-auth-oauthlib      1.0.0
grpcio                    1.57.0
idna                      3.4
imageio                   2.31.1
importlib-metadata        6.8.0
importlib-resources       6.0.1
iniconfig                 2.0.0
ipykernel                 6.25.1
ipython                   8.12.2
ipython-genutils          0.2.0
ipywidgets                8.1.0
isoduration               20.11.0
itsdangerous              2.1.2
jedi                      0.19.0
Jinja2                    3.1.2
jmespath                  0.10.0
joblib                    1.3.2
json5                     0.9.14
jsonpointer               2.4
jsonschema                4.19.0
jsonschema-specifications 2023.7.1
jstyleson                 0.0.2
jupyter                   1.0.0
jupyter_client            8.3.0
jupyter-console           6.6.3
jupyter_core              5.3.1
jupyter-events            0.7.0
jupyter-lsp               2.2.0
jupyter_server            2.7.2
jupyter_server_terminals  0.4.4
jupyterlab                4.0.5
jupyterlab-pygments       0.2.2
jupyterlab_server         2.24.0
jupyterlab-widgets        3.0.8
kiwisolver                1.4.4
lazy_loader               0.3
llvmlite                  0.40.1
lyft-dataset-sdk          0.0.8
lz4                       4.3.2
Markdown                  3.4.4
markdown-it-py            3.0.0
MarkupSafe                2.1.3
matplotlib                3.7.2
matplotlib-inline         0.1.6
mcap                      1.1.0
mcap-ros1-support         0.0.8
mccabe                    0.7.0
mdurl                     0.1.2
mistune                   3.0.1
mkl-fft                   1.3.1
mkl-random                1.2.2
mkl-service               2.4.0
mmcv                      2.0.0
mmdeploy                  1.2.0
mmdet                     3.0.0
mmdet3d                   1.1.0
mmengine                  0.8.4
model-index               0.1.11
multiprocess              0.70.15
mypy-extensions           1.0.0
nbclient                  0.8.0
nbconvert                 7.7.4
nbformat                  5.9.2
nest-asyncio              1.5.7
networkx                  2.8.8
notebook                  7.0.2
notebook_shim             0.2.3
numba                     0.57.1
numpy                     1.24.4
nuscenes-devkit           1.1.10
oauthlib                  3.2.2
olefile                   0.46
onnx                      1.14.0
onnxruntime               1.8.1
open3d                    0.10.0.0
opencv-python             4.8.0.76
opendatalab               0.0.10
openmim                   0.3.9
openvino                  2023.0.1
openvino-dev              2023.0.1
openvino-telemetry        2023.1.1
openxlab                  0.0.17
ordered-set               4.1.0
oss2                      2.17.0
overrides                 7.4.0
packaging                 23.1
pandas                    2.0.3
pandocfilters             1.5.0
parso                     0.8.3
pathspec                  0.11.2
pexpect                   4.8.0
pickleshare               0.7.5
Pillow                    10.0.0
pip                       23.2.1
pkgutil_resolve_name      1.3.10
platformdirs              3.10.0
plotly                    5.16.1
pluggy                    1.2.0
plyfile                   1.0.1
prettytable               3.8.0
prometheus-client         0.17.1
prompt-toolkit            3.0.39
protobuf                  3.20.2
psutil                    5.9.5
ptyprocess                0.7.0
pure-eval                 0.2.2
pyasn1                    0.5.0
pyasn1-modules            0.3.0
pycocotools               2.0.7
pycodestyle               2.11.0
pycparser                 2.21
pycryptodome              3.18.0
pyflakes                  3.1.0
Pygments                  2.16.1
pyparsing                 3.0.9
PyQt5                     5.15.5
PyQt5-Qt5                 5.15.2
PyQt5-sip                 12.12.2
pyquaternion              0.9.9
pytest                    7.4.0
python-dateutil           2.8.2
python-json-logger        2.0.7
pytz                      2023.3
pyusb                     1.2.1
PyWavelets                1.4.1
PyYAML                    6.0.1
pyzmq                     25.1.1
qtconsole                 5.4.3
QtPy                      2.3.1
referencing               0.30.2
requests                  2.31.0
requests-oauthlib         1.3.1
retrying                  1.3.4
rfc3339-validator         0.1.4
rfc3986-validator         0.1.1
rich                      13.4.2
rosbags                   0.9.11
rpds-py                   0.9.2
rsa                       4.9
ruamel.yaml               0.17.32
ruamel.yaml.clib          0.2.7
scikit-image              0.21.0
scikit-learn              1.3.0
scipy                     1.10.1
Send2Trash                1.8.2
sentry-sdk                1.5.1
setuptools                60.2.0
Shapely                   1.8.5
six                       1.16.0
sniffio                   1.3.0
soupsieve                 2.4.1
stack-data                0.6.2
tabulate                  0.9.0
tenacity                  8.2.3
tensorboard               2.14.0
tensorboard-data-server   0.7.1
termcolor                 2.3.0
terminado                 0.17.1
terminaltables            3.1.10
texttable                 1.6.7
threadpoolctl             3.2.0
tifffile                  2023.7.10
tinycss2                  1.2.1
tomli                     2.0.1
torch                     1.10.1
torchaudio                0.10.1
torchvision               0.11.2
tornado                   6.3.3
tqdm                      4.65.2
traitlets                 5.9.0
trimesh                   3.23.3
typing_extensions         4.7.1
tzdata                    2023.3
uri-template              1.3.0
urllib3                   1.26.16
wcwidth                   0.2.6
webcolors                 1.13
webencodings              0.5.1
websocket-client          1.6.2
Werkzeug                  2.2.3
wheel                     0.38.4
widgetsnbextension        4.0.8
yapf                      0.40.1
zipp                      3.16.2
zstandard                 0.21.0

Error traceback


python tools/deploy.py  configs/mmdet3d/voxel-detection/voxel-detection_onnxruntime_dynamic.py /home/david/mmdet3d/mmdetection3d/configs/centerpoint/centerpoint_pillar02_second_secfpn_head-circlenms_8xb4-cyclic-20e_nus-3d.py  /home/david/mmdet3d/centerpoint_02pillar_second_secfpn_circlenms_4x8_cyclic_20e_nus_20220811_031844-191a3822.pth  /home/david/mmdet3d/v1.0-mini/sweeps/LIDAR_TOP/n008-2018-08-01-15-16-36-0400__LIDAR_TOP__1533151603747767.pcd.bin --work-dir centerpoint
Here is the error : Traceback (most recent call last):
File "/home/david/miniconda3/envs/openmmlab/lib/python3.8/site-packages/mmdeploy/utils/utils.py", line 41, in target_wrapper
result = target(*args, **kwargs)
File "/home/david/miniconda3/envs/openmmlab/lib/python3.8/site-packages/mmdeploy/apis/visualize.py", line 72, in visualize_model
result = model.test_step(model_inputs)[0]
File "/home/david/.local/lib/python3.8/site-packages/mmengine/model/base_model/base_model.py", line 145, in test_step
return self._run_forward(data, mode='predict') # type: ignore
File "/home/david/.local/lib/python3.8/site-packages/mmengine/model/base_model/base_model.py", line 340, in _run_forward
results = self(**data, mode=mode)
File "/home/david/miniconda3/envs/openmmlab/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/home/david/miniconda3/envs/openmmlab/lib/python3.8/site-packages/mmdeploy/codebase/mmdet3d/deploy/voxel_detection_model.py", line 104, in forward
prediction = VoxelDetectionModel.postprocess(
File "/home/david/miniconda3/envs/openmmlab/lib/python3.8/site-packages/mmdeploy/codebase/mmdet3d/deploy/voxel_detection_model.py", line 273, in postprocess
batch_heatmap = cls_score[:,
TypeError: list indices must be integers or slices, not tuple
08/24 10:38:16 - mmengine - ERROR - tools/deploy.py - create_process - 82 - visualize onnxruntime model failed.
tpoisonooo commented 1 year ago

Can you locate where

python: malloc.c:4105: _int_malloc: Assertion `chunk_main_arena (bck->bk)' failed

comes from ? It looks like an installation error.

DavidZah commented 1 year ago

Oh am really sorry this is not the error i was experiencing it was fixed after env restart. Here is the error : Traceback (most recent call last): File "/home/david/miniconda3/envs/openmmlab/lib/python3.8/site-packages/mmdeploy/utils/utils.py", line 41, in target_wrapper result = target(args, kwargs) File "/home/david/miniconda3/envs/openmmlab/lib/python3.8/site-packages/mmdeploy/apis/visualize.py", line 72, in visualize_model result = model.test_step(model_inputs)[0] File "/home/david/.local/lib/python3.8/site-packages/mmengine/model/base_model/base_model.py", line 145, in test_step return self._run_forward(data, mode='predict') # type: ignore File "/home/david/.local/lib/python3.8/site-packages/mmengine/model/base_model/base_model.py", line 340, in _run_forward results = self(data, mode=mode) File "/home/david/miniconda3/envs/openmmlab/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl return forward_call(input, **kwargs) File "/home/david/miniconda3/envs/openmmlab/lib/python3.8/site-packages/mmdeploy/codebase/mmdet3d/deploy/voxel_detection_model.py", line 104, in forward prediction = VoxelDetectionModel.postprocess( File "/home/david/miniconda3/envs/openmmlab/lib/python3.8/site-packages/mmdeploy/codebase/mmdet3d/deploy/voxel_detection_model.py", line 273, in postprocess batch_heatmap = cls_score[:, TypeError: list indices must be integers or slices, not tuple 08/24 10:38:16 - mmengine - ERROR - tools/deploy.py - create_process - 82 - visualize onnxruntime model failed.

RunningLeon commented 1 year ago

@DavidZah hi, it should be fixed in here. pls. try with the latest mmdeploy https://github.com/open-mmlab/mmdeploy/blob/4dbba14643e1e6e6ab348c88d8abb974c585aeed/mmdeploy/codebase/mmdet3d/deploy/voxel_detection_model.py#L259-L261

github-actions[bot] commented 1 year ago

This issue is marked as stale because it has been marked as invalid or awaiting response for 7 days without any further response. It will be closed in 5 days if the stale label is not removed or if there is no further response.

github-actions[bot] commented 1 year ago

This issue is closed because it has been stale for 5 days. Please open a new issue if you have similar issues or you have any new updates now.

artificialzjy commented 2 weeks ago

I want to ask how to set the data_path when running tools/deploy.py on KITTI datasets for KITTI datasets have no files of ".pcd.bin" format.