mmdeploy
mmdeploy copied to clipboard
[Bug] onnex differs from pytorch model
Checklist
- [X] I have searched related issues but cannot get the expected help.
- [X] 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
I have exported mask2former successifully. but the output output_onnxruntime_0.png differs from output_pytorch_0.png, what is the reason?
output_pytorch_0.png
output_onnxruntime_0.png
Reproduction
python tools/deploy.py configs/mmseg/segmentation_onnxruntime_dynamic.py ../mmsegmentation/configs/mask2former/mask2former_swin-b-in1k-384x384-pre_8xb2-160k_bank-640x640.py ../mmsegmentation/work_dirs/mask2former_swin-b-in1k-384x384-pre_8xb2-160k_bank-640x640/best_mIoU_iter_50000.pth ../mmsegmentation/demo/demo_bank01.png --work-dir mmdeploy_models/mask2former --device cpu --show --dump-info
Environment
02/28 19:06:36 - mmengine - INFO -
02/28 19:06:36 - mmengine - INFO - **********Environmental information**********
02/28 19:06:37 - mmengine - INFO - sys.platform: linux
02/28 19:06:37 - mmengine - INFO - Python: 3.8.17 (default, Jul 5 2023, 21:04:15) [GCC 11.2.0]
02/28 19:06:37 - mmengine - INFO - CUDA available: True
02/28 19:06:37 - mmengine - INFO - numpy_random_seed: 2147483648
02/28 19:06:37 - mmengine - INFO - GPU 0: NVIDIA GeForce RTX 3090
02/28 19:06:37 - mmengine - INFO - CUDA_HOME: /usr/local/cuda
02/28 19:06:37 - mmengine - INFO - NVCC: Cuda compilation tools, release 11.1, V11.1.105
02/28 19:06:37 - mmengine - INFO - GCC: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
02/28 19:06:37 - mmengine - INFO - PyTorch: 1.10.1
02/28 19:06:37 - mmengine - INFO - PyTorch compiling details: PyTorch built with:
- 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.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: AVX512
- 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,
02/28 19:06:37 - mmengine - INFO - TorchVision: 0.11.2
02/28 19:06:37 - mmengine - INFO - OpenCV: 4.9.0
02/28 19:06:37 - mmengine - INFO - MMEngine: 0.7.1
02/28 19:06:37 - mmengine - INFO - MMCV: 2.0.0rc4
02/28 19:06:37 - mmengine - INFO - MMCV Compiler: GCC 7.5
02/28 19:06:37 - mmengine - INFO - MMCV CUDA Compiler: 11.1
02/28 19:06:37 - mmengine - INFO - MMDeploy: 1.3.1+bc75c9d
02/28 19:06:37 - mmengine - INFO -
02/28 19:06:37 - mmengine - INFO - **********Backend information**********
02/28 19:06:40 - mmengine - INFO - tensorrt: 8.6.1
02/28 19:06:40 - mmengine - INFO - tensorrt custom ops: NotAvailable
02/28 19:06:40 - mmengine - INFO - ONNXRuntime: 1.8.1
02/28 19:06:40 - mmengine - INFO - ONNXRuntime-gpu: 1.8.1
02/28 19:06:40 - mmengine - INFO - ONNXRuntime custom ops: Available
02/28 19:06:40 - mmengine - INFO - pplnn: None
02/28 19:06:40 - mmengine - INFO - ncnn: None
02/28 19:06:40 - mmengine - INFO - snpe: None
02/28 19:06:40 - mmengine - INFO - openvino: None
02/28 19:06:40 - mmengine - INFO - torchscript: 1.10.1
02/28 19:06:40 - mmengine - INFO - torchscript custom ops: NotAvailable
02/28 19:06:40 - mmengine - INFO - rknn-toolkit: None
02/28 19:06:40 - mmengine - INFO - rknn-toolkit2: None
02/28 19:06:40 - mmengine - INFO - ascend: None
02/28 19:06:40 - mmengine - INFO - coreml: None
02/28 19:06:40 - mmengine - INFO - tvm: None
02/28 19:06:40 - mmengine - INFO - vacc: None
02/28 19:06:40 - mmengine - INFO -
02/28 19:06:40 - mmengine - INFO - **********Codebase information**********
02/28 19:06:40 - mmengine - INFO - mmdet: 3.1.0
02/28 19:06:40 - mmengine - INFO - mmseg: 1.1.1
02/28 19:06:40 - mmengine - INFO - mmpretrain: None
02/28 19:06:40 - mmengine - INFO - mmocr: None
02/28 19:06:40 - mmengine - INFO - mmagic: None
02/28 19:06:40 - mmengine - INFO - mmdet3d: None
02/28 19:06:40 - mmengine - INFO - mmpose: None
02/28 19:06:40 - mmengine - INFO - mmrotate: None
02/28 19:06:40 - mmengine - INFO - mmaction: None
02/28 19:06:40 - mmengine - INFO - mmrazor: None
02/28 19:06:40 - mmengine - INFO - mmyolo: None
Error traceback
No response