open-mmlab / mmdetection3d

OpenMMLab's next-generation platform for general 3D object detection.
https://mmdetection3d.readthedocs.io/en/latest/
Apache License 2.0
5.2k stars 1.53k forks source link

KeyError: 'CocoDataset is not in the dataset registry' #1531

Closed ajinkyakhoche closed 2 years ago

ajinkyakhoche commented 2 years ago

Thanks for your wonderful library! Please find my error description

Checklist

  1. I have searched related issues but cannot get the expected help. I looked up issues in mmcv and mmdetection too, but didn't find anything there.
  2. The bug has not been fixed in the latest version.

Describe the bug I'm trying to test nuImage using the test.py script, but I can't find CocoDataset in the registry

Reproduction

  1. What command or script did you run?
python tools/test.py configs/nuimages/htc_x101_64x4d_fpn_dconv_c3-c5_coco-20e_16x1_20e_nuim.py checkpoints/htc_x101_64x4d_fpn_dconv_c3-c5_coco-20e_16x1_20e_nuim_20201008_211222-0b16ac4b.pth --show 
  1. Did you make any modifications on the code or config? Did you understand what you have modified? No

  2. What dataset did you use? NuImages

Environment

  1. Please run python mmdet3d/utils/collect_env.py to collect necessary environment information and paste it here.
    
    sys.platform: linux
    Python: 3.8.10 (default, Mar 15 2022, 12:22:08) [GCC 9.4.0]
    CUDA available: True
    GPU 0: NVIDIA GeForce GTX 1080 Ti
    CUDA_HOME: /usr/local/cuda-11.0
    NVCC: Cuda compilation tools, release 11.0, V11.0.194
    GCC: x86_64-linux-gnu-gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
    PyTorch: 1.7.0+cu110
    PyTorch compiling details: PyTorch built with:
    - GCC 7.3
    - C++ Version: 201402
    - Intel(R) Math Kernel Library Version 2020.0.0 Product Build 20191122 for Intel(R) 64 architecture applications
    - Intel(R) MKL-DNN v1.6.0 (Git Hash 5ef631a030a6f73131c77892041042805a06064f)
    - OpenMP 201511 (a.k.a. OpenMP 4.5)
    - NNPACK is enabled
    - CPU capability usage: AVX2
    - CUDA Runtime 11.0
    - 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
    - CuDNN 8.0.4
    - Magma 2.5.2
    - Build settings: BLAS=MKL, BUILD_TYPE=Release, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DUSE_VULKAN_WRAPPER -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, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, USE_CUDA=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, 

TorchVision: 0.8.1+cu110 OpenCV: 4.5.4-dev MMCV: 1.5.0 MMCV Compiler: GCC 9.4 MMCV CUDA Compiler: 11.0 MMDetection: 2.25.0 MMSegmentation: 0.24.1 MMDetection3D: 1.0.0rc2+b560c6b spconv2.0: False


2. You may add addition that may be helpful for locating the problem, such as
    - How you installed PyTorch [e.g., ~~pip~~, conda, ~~source~~]
    - Other environment variables that may be related (such as `$PATH`, `$LD_LIBRARY_PATH`, `$PYTHONPATH`, etc.)

**Error traceback**
If applicable, paste the error trackback here.

Traceback (most recent call last): File "tools/test.py", line 260, in main() File "tools/test.py", line 203, in main dataset = build_dataset(cfg.data.test) File "mmdetection3d/mmdet3d/datasets/builder.py", line 43, in build_dataset dataset = build_from_cfg(cfg, DATASETS, default_args) File "/home//.local/lib/python3.8/site-packages/mmcv/utils/registry.py", line 44, in build_from_cfg raise KeyError( KeyError: 'CocoDataset is not in the dataset registry'



**Bug fix**
If you have already identified the reason, you can provide the information here. If you are willing to create a PR to fix it, please also leave a comment here and that would be much appreciated!
Tai-Wang commented 2 years ago

That may be related to our refactor about the registry scope of mmdet and mmdet3d. Please @ZCMax have a check.

ZCMax commented 2 years ago

Yes, it's the problem caused by registry refactor, it should be solved by #1536