mmdeploy
mmdeploy copied to clipboard
[Bug] Failed to convert fcos-resnet50 to onnx
Checklist
- [X] I have searched related issues but cannot get the expected help.
- [ ] 2. I have read the FAQ documentation but cannot get the expected help.
- [ ] 3. The bug has not been fixed in the latest version.
Describe the bug
With convert cmd:
#!/bin/bash
MMDETECTION_HOME=/home/work/cv_hub/mmdetection
MMDEPLOY_HOME=/home/work/cv_hub/mmdeploy
#source /usr/local/Ascend/ascend-toolkit/set_env.sh
export PYTHONPATH=${MMDEPLOY_HOME}:${PYTHONPATH}
cd ${MMDEPLOY_HOME}
python tools/deploy.py \
configs/mmdet/detection/detection_onnxruntime_dynamic.py \
${MMDETECTION_HOME}/configs/fcos/fcos_r50-caffe_fpn_gn-head_1x_coco.py \
/home/work/cv_hub/model/fcos/fcos_r50_caffe_fpn_gn-head_1x_coco-821213aa.pth \
demo/resources/det.jpg \
--work-dir ${MMDETECTION_HOME}/dist_fcos_r50_workdir/ort \
--device cpu \
--show \
--dump-info
it fails with error
While the model and config are download from mmdetection repo pages: https://github.com/open-mmlab/mmdetection/blob/3.x/configs/fcos/fcos_r50-caffe_fpn_gn-head_1x_coco.py https://download.openmmlab.com/mmdetection/v2.0/fcos/fcos_r50_caffe_fpn_gn-head_1x_coco/fcos_r50_caffe_fpn_gn-head_1x_coco-821213aa.pth
Reproduction
you could just use tools/deploy.py to reproduce
Environment
python ./tools/check_env.py
04/15 19:35:51 - mmengine - INFO -
04/15 19:35:51 - mmengine - INFO - **********Environmental information**********
04/15 19:35:53 - mmengine - INFO - sys.platform: linux
04/15 19:35:53 - mmengine - INFO - Python: 3.9.18 (main, Sep 11 2023, 13:41:44) [GCC 11.2.0]
04/15 19:35:53 - mmengine - INFO - CUDA available: True
04/15 19:35:53 - mmengine - INFO - MUSA available: False
04/15 19:35:53 - mmengine - INFO - numpy_random_seed: 2147483648
04/15 19:35:53 - mmengine - INFO - GPU 0,1,2,3,4,5,6,7: NVIDIA A100 80GB PCIe
04/15 19:35:53 - mmengine - INFO - CUDA_HOME: /usr/local/cuda
04/15 19:35:53 - mmengine - INFO - NVCC: Cuda compilation tools, release 11.8, V11.8.89
04/15 19:35:53 - mmengine - INFO - GCC: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
04/15 19:35:53 - mmengine - INFO - PyTorch: 2.1.0+cu118
04/15 19:35:53 - mmengine - INFO - PyTorch compiling details: PyTorch built with:
- GCC 9.3
- C++ Version: 201703
- Intel(R) oneAPI Math Kernel Library Version 2022.2-Product Build 20220804 for Intel(R) 64 architecture applications
- Intel(R) MKL-DNN v3.1.1 (Git Hash 64f6bcbcbab628e96f33a62c3e975f8535a7bde4)
- OpenMP 201511 (a.k.a. OpenMP 4.5)
- LAPACK is enabled (usually provided by MKL)
- NNPACK is enabled
- CPU capability usage: AVX512
- CUDA Runtime 11.8
- NVCC architecture flags: -gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-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=sm_37;-gencode;arch=compute_90,code=sm_90
- CuDNN 8.7
- Magma 2.6.1
- Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=11.8, CUDNN_VERSION=8.7.0, CXX_COMPILER=/opt/rh/devtoolset-9/root/usr/bin/c++, CXX_FLAGS= -D_GLIBCXX_USE_CXX11_ABI=0 -fabi-version=11 -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOROCTRACER -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -O2 -fPIC -Wall -Wextra -Werror=return-type -Werror=non-virtual-dtor -Werror=bool-operation -Wnarrowing -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=old-style-cast -Wno-invalid-partial-specialization -Wno-unused-private-field -Wno-aligned-allocation-unavailable -Wno-missing-braces -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Werror=cast-function-type -Wno-stringop-overflow, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_DISABLE_GPU_ASSERTS=ON, TORCH_VERSION=2.1.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=1, USE_NNPACK=ON, USE_OPENMP=ON, USE_ROCM=OFF,
04/15 19:35:53 - mmengine - INFO - TorchVision: 0.16.0+cu118
04/15 19:35:53 - mmengine - INFO - OpenCV: 4.9.0
04/15 19:35:53 - mmengine - INFO - MMEngine: 0.10.3
04/15 19:35:53 - mmengine - INFO - MMCV: 2.1.0
04/15 19:35:53 - mmengine - INFO - MMCV Compiler: GCC 9.3
04/15 19:35:53 - mmengine - INFO - MMCV CUDA Compiler: 11.8
04/15 19:35:53 - mmengine - INFO - MMDeploy: 1.3.1+
04/15 19:35:53 - mmengine - INFO -
04/15 19:35:53 - mmengine - INFO - **********Backend information**********
04/15 19:35:53 - mmengine - INFO - tensorrt: 8.6.1.post1
04/15 19:35:53 - mmengine - INFO - tensorrt custom ops: NotAvailable
04/15 19:35:53 - mmengine - INFO - ONNXRuntime: 1.17.3
04/15 19:35:53 - mmengine - INFO - ONNXRuntime-gpu: None
04/15 19:35:53 - mmengine - INFO - ONNXRuntime custom ops: NotAvailable
04/15 19:35:53 - mmengine - INFO - pplnn: None
04/15 19:35:53 - mmengine - INFO - ncnn: None
04/15 19:35:53 - mmengine - INFO - snpe: None
04/15 19:35:53 - mmengine - INFO - openvino: None
04/15 19:35:53 - mmengine - INFO - torchscript: 2.1.0+cu118
04/15 19:35:53 - mmengine - INFO - torchscript custom ops: NotAvailable
04/15 19:35:53 - mmengine - INFO - rknn-toolkit: None
04/15 19:35:53 - mmengine - INFO - rknn-toolkit2: None
04/15 19:35:53 - mmengine - INFO - ascend: None
04/15 19:35:53 - mmengine - INFO - coreml: None
04/15 19:35:53 - mmengine - INFO - tvm: None
04/15 19:35:53 - mmengine - INFO - vacc: None
04/15 19:35:53 - mmengine - INFO -
04/15 19:35:53 - mmengine - INFO - **********Codebase information**********
04/15 19:35:53 - mmengine - INFO - mmdet: 3.3.0
04/15 19:35:53 - mmengine - INFO - mmseg: None
04/15 19:35:53 - mmengine - INFO - mmpretrain: None
04/15 19:35:53 - mmengine - INFO - mmocr: None
04/15 19:35:53 - mmengine - INFO - mmagic: None
04/15 19:35:53 - mmengine - INFO - mmdet3d: None
04/15 19:35:53 - mmengine - INFO - mmpose: None
04/15 19:35:53 - mmengine - INFO - mmrotate: None
04/15 19:35:53 - mmengine - INFO - mmaction: None
04/15 19:35:53 - mmengine - INFO - mmrazor: None
04/15 19:35:53 - mmengine - INFO - mmyolo: None
Error traceback
No response
Hi, could anyone help?