open-mmlab / mmdeploy

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

RTMO model convert to onnx #2734

Open anzisheng opened 7 months ago

anzisheng commented 7 months ago

Checklist

Describe the bug

I met an error when I export rtmo model to onnx RuntimeError: Exporting the operator linalg_norm to ONNX opset version 11 is not supported. Please feel free to request support or submit a pull request on PyTorch GitHub. Who can tell me the reason about this Error and how to fix it?

Reproduction

python3 /home/an/MMDeploy/tools/deploy.py configs/mmpose/pose-detection_rtmo_onnxruntime_dynamic.py ../mmpose/configs/body_2d_keypoint/rtmo/body7/rtmo-s_8xb32-600e_body7-640x640.py ../rtmo-l_16xb16-600e_body7-640x640-b37118ce_20231211.pth ../image.jpg --work-dir rtmo_result --device cpu --show --dump-info

Environment

- GCC 7.3
  - C++ Version: 201402
  - Intel(R) oneAPI Math Kernel Library Version 2023.1-Product Build 20230303 for Intel(R) 64 architecture applications
  - Intel(R) MKL-DNN v2.1.2 (Git Hash 98be7e8afa711dc9b66c8ff3504129cb82013cdb)
  - OpenMP 201511 (a.k.a. OpenMP 4.5)
  - NNPACK is enabled
  - CPU capability usage: AVX2
  - Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=10.2, CUDNN_VERSION=7.6.5, 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 -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.9.0, 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, 

04/09 23:30:32 - mmengine - INFO - TorchVision: 0.10.0
04/09 23:30:32 - mmengine - INFO - OpenCV: 4.9.0
04/09 23:30:32 - mmengine - INFO - MMEngine: 0.10.3
04/09 23:30:32 - mmengine - INFO - MMCV: 2.0.1
04/09 23:30:32 - mmengine - INFO - MMCV Compiler: GCC 7.3
04/09 23:30:32 - mmengine - INFO - MMCV CUDA Compiler: 10.2
04/09 23:30:32 - mmengine - INFO - MMDeploy: 1.0.0+bc75c9d
04/09 23:30:32 - mmengine - INFO - 

04/09 23:30:32 - mmengine - INFO - **********Backend information**********
04/09 23:30:32 - mmengine - INFO - tensorrt:    None
04/09 23:30:32 - mmengine - INFO - ONNXRuntime: 1.8.1
04/09 23:30:32 - mmengine - INFO - ONNXRuntime-gpu:     1.8.1
04/09 23:30:32 - mmengine - INFO - ONNXRuntime custom ops:      Available
04/09 23:30:32 - mmengine - INFO - pplnn:       None
04/09 23:30:32 - mmengine - INFO - ncnn:        None
04/09 23:30:32 - mmengine - INFO - snpe:        None
04/09 23:30:32 - mmengine - INFO - openvino:    None
04/09 23:30:32 - mmengine - INFO - torchscript: 1.9.0
04/09 23:30:32 - mmengine - INFO - torchscript custom ops:      NotAvailable
04/09 23:30:32 - mmengine - INFO - rknn-toolkit:        None
04/09 23:30:32 - mmengine - INFO - rknn-toolkit2:       1.6.0+81f21f4d
04/09 23:30:32 - mmengine - INFO - ascend:      None
04/09 23:30:32 - mmengine - INFO - coreml:      None
04/09 23:30:32 - mmengine - INFO - tvm: None
04/09 23:30:32 - mmengine - INFO - vacc:        None
04/09 23:30:32 - mmengine - INFO - 

04/09 23:30:32 - mmengine - INFO - **********Codebase information**********
04/09 23:30:32 - mmengine - INFO - mmdet:       3.0.0
04/09 23:30:32 - mmengine - INFO - mmseg:       None
04/09 23:30:32 - mmengine - INFO - mmcls:       None
04/09 23:30:32 - mmengine - INFO - mmocr:       None
04/09 23:30:32 - mmengine - INFO - mmedit:      None
04/09 23:30:32 - mmengine - INFO - mmdet3d:     None
04/09 23:30:32 - mmengine - INFO - mmpose:      1.3.1
04/09 23:30:32 - mmengine - INFO - mmrotate:    None
04/09 23:30:32 - mmengine - INFO - mmaction:    None
04/09 23:30:32 - mmengine - INFO - mmrazor:     None

Error traceback

No response

pacifinapacific commented 6 months ago

Have you tried changing the version of pytorch to the required one? rtmo has a NOTICE

⭕ Notice:

PyTorch 1.12+ is required to export the ONNX model of RTMO!

MMDeploy v1.3.1+ is required to deploy RTMO.