open-mmlab / mmyolo

OpenMMLab YOLO series toolbox and benchmark. Implemented RTMDet, RTMDet-Rotated,YOLOv5, YOLOv6, YOLOv7, YOLOv8,YOLOX, PPYOLOE, etc.

Home Page:https://mmyolo.readthedocs.io/zh_CN/dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

converting to ONNX using docker image - KeyError: 'YOLODetector is not in the mmengine::model registry.

tomyot opened this issue Β· comments

Prerequisite

🐞 Describe the bug

I am using a docker image to export a model trained by mmyolo version 0.6.0.

check_env.py on mmdeploy docker image yields:

01/23 12:24:35 - mmengine - INFO -

01/23 12:24:35 - mmengine - INFO - Environmental information
01/23 12:24:37 - mmengine - INFO - sys.platform: linux
01/23 12:24:37 - mmengine - INFO - Python: 3.8.10 (default, May 26 2023, 14:05:08) [GCC 9.4.0]
01/23 12:24:37 - mmengine - INFO - CUDA available: True
01/23 12:24:37 - mmengine - INFO - numpy_random_seed: 2147483648
01/23 12:24:37 - mmengine - INFO - GPU 0,1,2,3: NVIDIA GeForce RTX 2080 Ti
01/23 12:24:37 - mmengine - INFO - CUDA_HOME: /usr/local/cuda
01/23 12:24:37 - mmengine - INFO - NVCC: Cuda compilation tools, release 11.8, V11.8.89
01/23 12:24:37 - mmengine - INFO - GCC: x86_64-linux-gnu-gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
01/23 12:24:37 - mmengine - INFO - PyTorch: 2.0.0+cu118
01/23 12:24:37 - 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 v2.7.3 (Git Hash 6dbeffbae1f23cbbeae17adb7b5b13f1f37c080e)
  • 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.8
  • 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_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_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 -Wno-deprecated -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 -Wunused-local-typedefs -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -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 -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.0.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,

01/23 12:24:37 - mmengine - INFO - TorchVision: 0.15.0+cu118
01/23 12:24:37 - mmengine - INFO - OpenCV: 4.5.4
01/23 12:24:37 - mmengine - INFO - MMEngine: 0.8.5
01/23 12:24:37 - mmengine - INFO - MMCV: 2.0.1
01/23 12:24:37 - mmengine - INFO - MMCV Compiler: GCC 9.3
01/23 12:24:37 - mmengine - INFO - MMCV CUDA Compiler: 11.8
01/23 12:24:37 - mmengine - INFO - MMDeploy: 1.3.0+4c376d9
01/23 12:24:37 - mmengine - INFO -

01/23 12:24:37 - mmengine - INFO - Backend information
01/23 12:24:37 - mmengine - INFO - tensorrt: 8.6.1
01/23 12:24:37 - mmengine - INFO - tensorrt custom ops: Available
01/23 12:24:37 - mmengine - INFO - ONNXRuntime: None
01/23 12:24:37 - mmengine - INFO - ONNXRuntime-gpu: 1.15.1
01/23 12:24:37 - mmengine - INFO - ONNXRuntime custom ops: Available
01/23 12:24:37 - mmengine - INFO - pplnn: 0.8.1
01/23 12:24:37 - mmengine - INFO - ncnn: 1.0.20230905
01/23 12:24:37 - mmengine - INFO - ncnn custom ops: Available
01/23 12:24:37 - mmengine - INFO - snpe: None
01/23 12:24:37 - mmengine - INFO - openvino: 2023.0.2
01/23 12:24:37 - mmengine - INFO - torchscript: 2.0.0+cu118
01/23 12:24:37 - mmengine - INFO - torchscript custom ops: Available
01/23 12:24:38 - mmengine - INFO - rknn-toolkit: None
01/23 12:24:38 - mmengine - INFO - rknn-toolkit2: None
01/23 12:24:38 - mmengine - INFO - ascend: None
01/23 12:24:38 - mmengine - INFO - coreml: None
01/23 12:24:38 - mmengine - INFO - tvm: None
01/23 12:24:38 - mmengine - INFO - vacc: None
01/23 12:24:38 - mmengine - INFO -

01/23 12:24:38 - mmengine - INFO - Codebase information
01/23 12:24:38 - mmengine - INFO - mmdet: 3.3.0
01/23 12:24:38 - mmengine - INFO - mmseg: None
01/23 12:24:38 - mmengine - INFO - mmpretrain: None
01/23 12:24:38 - mmengine - INFO - mmocr: None
01/23 12:24:38 - mmengine - INFO - mmagic: None
01/23 12:24:38 - mmengine - INFO - mmdet3d: None
01/23 12:24:38 - mmengine - INFO - mmpose: None
01/23 12:24:38 - mmengine - INFO - mmrotate: None
01/23 12:24:38 - mmengine - INFO - mmaction: None
01/23 12:24:38 - mmengine - INFO - mmrazor: None
01/23 12:24:38 - mmengine - INFO - mmyolo: None

Running the docker image, I am trying to export the yolo model using:

python3 ./tools/deploy.py configs/mmdet/detection/detection_onnxruntime_static.py "/home/pre-trained-models/config_yolox_m.py" "/home/pre-trained-models/epoch_425.pth" "/home/test_image.tif" --work-dir onnx-test --device cuda --dump-info

Getting the following error:
KeyError: 'YOLODetector is not in the mmengine::model registry. Please check whether the value of YOLODetector is correct or it was registered as expected.

Environment

sys.platform: linux
Python: 3.8.18 (default, Sep 11 2023, 13:40:15) [GCC 11.2.0]
CUDA available: True
numpy_random_seed: 2147483648
GPU 0,1: NVIDIA GeForce RTX 4090
CUDA_HOME: /usr/local/cuda
NVCC: Cuda compilation tools, release 12.2, V12.2.91
GCC: gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
PyTorch: 2.0.0
PyTorch compiling details: PyTorch built with:

  • GCC 9.3
  • C++ Version: 201703
  • Intel(R) oneAPI Math Kernel Library Version 2023.1-Product Build 20230303 for Intel(R) 64 architecture applications
  • Intel(R) MKL-DNN v2.7.3 (Git Hash 6dbeffbae1f23cbbeae17adb7b5b13f1f37c080e)
  • 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.7
  • 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.5
  • Magma 2.6.1
  • Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=11.7, CUDNN_VERSION=8.5.0, CXX_COMPILER=/opt/rh/devtoolset-9/root/usr/bin/c++, CXX_FLAGS= -D_GLIBCXX_USE_CXX11_ABI=0 -fabi-version=11 -Wno-deprecated -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 -Wunused-local-typedefs -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -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 -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.0.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, USE_ROCM=OFF,

TorchVision: 0.15.0
OpenCV: 4.8.1
MMEngine: 0.10.2
MMCV: 2.0.1
MMDetection: 3.3.0
MMYOLO: 0.6.0+8c4d9dc

Additional information

No response