exiawsh / StreamPETR

[ICCV 2023] StreamPETR: Exploring Object-Centric Temporal Modeling for Efficient Multi-View 3D Object Detection
Other
588 stars 63 forks source link

KeyError: 'Petr3D is not in the models registry' #91

Closed furyNerd closed 1 year ago

furyNerd commented 1 year ago

hi, i simply just wanted to try if mono_det_demo.py of mmdet3d could works. according docs, my command is like:

export cam_ann=/StreamPETR/mmdetection3d/demo/data/kitti/kitti_000008_infos.pkl
export img_uri=/StreamPETR/mmdetection3d/demo/data/kitti/kitti_000008.png
export mdl_cfg=/StreamPETR/projects/configs/StreamPETR/stream_petr_vov_flash_800_bs2_seq_24e.py
export mdl_ckp=/StreamPETR/ckpts/stream_petr_vov_flash_800_bs2_seq_24e.pth # downloaded in advance
export out_dir=/StreamPETR/my_test/stream_petr_ki.png
python demo/mono_det_demo.py ${img_uri} ${cam_ann} ${mdl_cfg} ${mdl_ckp} --out-dir ${out_dir}

but i tried all possibles, always got errors like:

(streampetr) root@4feaf720ae18:/StreamPETR/mmdetection3d# python demo/mono_det_demo.py ${img_uri} ${cam_ann} ${mdl_cfg} ${mdl_ckp} --out-dir ${out_dir}
Traceback (most recent call last):
  File "demo/mono_det_demo.py", line 46, in <module>
    main()
  File "demo/mono_det_demo.py", line 31, in main
    model = init_model(args.config, args.checkpoint, device=args.device)
  File "/StreamPETR/mmdetection3d/mmdet3d/apis/inference.py", line 60, in init_model
    model = build_model(config.model, test_cfg=config.get('test_cfg'))
  File "/StreamPETR/mmdetection3d/mmdet3d/models/builder.py", line 122, in build_model
    return build_detector(cfg, train_cfg=train_cfg, test_cfg=test_cfg)
  File "/StreamPETR/mmdetection3d/mmdet3d/models/builder.py", line 95, in build_detector
    return MMDET_DETECTORS.build(
  File "/root/miniconda3/envs/streampetr/lib/python3.8/site-packages/mmcv/utils/registry.py", line 237, in build
    return self.build_func(*args, **kwargs, registry=self)
  File "/root/miniconda3/envs/streampetr/lib/python3.8/site-packages/mmcv/cnn/builder.py", line 27, in build_model_from_cfg
    return build_from_cfg(cfg, registry, default_args)
  File "/root/miniconda3/envs/streampetr/lib/python3.8/site-packages/mmcv/utils/registry.py", line 61, in build_from_cfg
    raise KeyError(
KeyError: 'Petr3D is not in the models registry'

i investigated but dit not get any clue, could i have some advice? thanks so much

exiawsh commented 1 year ago

@furyNerd PETR does not support inference on the kitti dataset. Please follow our guidance in https://github.com/exiawsh/StreamPETR/blob/main/docs/training_inference.md

furyNerd commented 1 year ago

hi @exiawsh , thanks for reply, i can reproduce the repo's results with your guidance. here i just wish to do something same like #14 as you suggusted https://github.com/exiawsh/StreamPETR/issues/14#issuecomment-1547344984, however the fabrication of **data looks like sophisticated... so i just wish to make a quick taste of StreamPETR by mmdet3d's official demo (though not sure if it is applicable).

and with using the nuscence dataset,

export cam_ann=/StreamPETR/mmdetection3d/demo/data/nuscenes/n015-2018-07-24-11-22-45+0800__CAM_BACK__1532402927637525_mono3d.coco.json
export img_uri=/StreamPETR/mmdetection3d/demo/data/nuscenes/n015-2018-07-24-11-22-45+0800__CAM_BACK__1532402927637525.jpg

i still got the same error...and according literally to the error, look like it's not the matter of dataset, but the method of registry with mmdet3d?

very much appreciate for any advice or comment :)

exiawsh commented 1 year ago

@furyNerd You'd better build your own dataset in the projects plugin rather than directly use mmdet3d.