open-mmlab / mmdetection3d

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

[Bug] 'CocoDataset is not in the mmdet3d::dataset registry. #2966

Open jiangxb98 opened 2 months ago

jiangxb98 commented 2 months ago

Prerequisite

Task

I'm using the official example scripts/configs for the officially supported tasks/models/datasets.

Branch

1.x branch https://github.com/open-mmlab/mmdetection3d/tree/dev-1.x

Environment

sys.platform: linux Python: 3.8.19 (default, Mar 20 2024, 19:58:24) [GCC 11.2.0] CUDA available: True MUSA available: False numpy_random_seed: 2147483648 GPU 0,1,2,3,4,5,6,7: Tesla V100-PCIE-32GB CUDA_HOME: /usr/local/cuda-12 NVCC: Cuda compilation tools, release 12.0, V12.0.76 GCC: gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0 PyTorch: 2.1.0+cu121 PyTorch compiling details: PyTorch built with:

TorchVision: 0.16.0+cu121 OpenCV: 4.9.0 MMEngine: 0.10.4 MMDetection: 3.3.0 MMDetection3D: 1.4.0+962f093 spconv2.0: False

Reproduces the problem - code sample

from mmdet.apis import inference_detector, init_detector

model = init_detector('configs/nuimages/htc_r50_fpn_coco-20e-1x_nuim.py', device='cuda:0', checkpoint='model_pth/htc_r50_fpn_coco-20e_20e_nuim_20201008_211415-d6c60a2c.pth')

Reproduces the problem - command or script

from mmdet.apis import inference_detector, init_detector

model = init_detector('configs/nuimages/htc_r50_fpn_coco-20e-1x_nuim.py', device='cuda:0', checkpoint='model_pth/htc_r50_fpn_coco-20e_20e_nuim_20201008_211415-d6c60a2c.pth')

Reproduces the problem - error message

KeyError: 'CocoDataset is not in the mmdet3d::dataset registry. Please check whether the value of CocoDataset is correct or it was registered as expected. More details can be found at https://mmengine.readthedocs.io/en/latest/advanced_tutorials/config.html#import-the-custom-module'

Additional information

No response

jiangxb98 commented 2 months ago

Note: I have add the test_dataloader for the nuim-instance.py, if not add this, will error: File "/miniconda3/envs/openmmlab/lib/python3.8/site-packages/mmengine/config/config.py", line 113, in getattr raise AttributeError(f"'{self.class.name}' object has no " AttributeError: 'ConfigDict' object has no attribute 'test_dataloader'

VeeranajenyuluT commented 1 month ago

May be i misunderstood but looks like for cocodataset, you should refer to mmdetection not mmdetection3D. Check here https://github.com/open-mmlab/mmdetection/blob/main/mmdet/datasets/coco.py. I believe cocodataset is 2D detection not for 3D, is not it?