open-mmlab / mmaction2

OpenMMLab's Next Generation Video Understanding Toolbox and Benchmark
https://mmaction2.readthedocs.io
Apache License 2.0
4.06k stars 1.2k forks source link

'PackDetInputs is not in the mmaction::transform registry. Please check whether the value of `PackDetInputs` is correct or it was registered as expected. #2747

Open 15598003953 opened 8 months ago

15598003953 commented 8 months ago

Branch

main branch (1.x version, such as v1.0.0, or dev-1.x branch)

Prerequisite

Environment

pytorch=1.12.1 python=3.8 cuda=11.6 mmcv=2.0.1 mmengine=0.90 mmdet=3.2.0

Describe the bug

running code:webcam_demo_spatiotemporal_det.py cfg:configs\detection\slowfast\slowfast_kinetics400-pretrained-r50_8xb6-8x8x1-cosine-10e_ava22-rgb.py det_cfg:configs\faster_rcnn\faster-rcnn_r50_fpn_2x_coco.py

Reproduces the problem - code sample

Traceback (most recent call last): File "D:/CODE/mmaction2-main/demo/webcam_demo_spatiotemporal_det.py", line 856, in main(parse_args()) File "D:/CODE/mmaction2-main/demo/webcam_demo_spatiotemporal_det.py", line 831, in main human_detector.predict(task) File "D:/CODE/mmaction2-main/demo/webcam_demo_spatiotemporal_det.py", line 224, in predict bboxes = self._do_detect(keyframe) File "D:/CODE/mmaction2-main/demo/webcam_demo_spatiotemporal_det.py", line 258, in _do_detect det_data_sample = inference_detector(self.model, image) File "D:\CODE\mmaction2-main\mmdetection-main\mmdet\apis\inference.py", line 159, in inference_detector test_pipeline = Compose(test_pipeline) File "D:\Anaconda3\envs\mmact2\lib\site-packages\mmcv\transforms\wrappers.py", line 66, in init transform = TRANSFORMS.build(transform) File "D:\Anaconda3\envs\mmact2\lib\site-packages\mmengine\registry\registry.py", line 570, in build return self.build_func(cfg, *args, **kwargs, registry=self) File "D:\Anaconda3\envs\mmact2\lib\site-packages\mmengine\registry\build_functions.py", line 100, in build_from_cfg raise KeyError( KeyError: 'PackDetInputs is not in the mmaction::transform registry. Please check whether the value of PackDetInputs 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'

Reproduces the problem - command or script

webcam_demo_spatiotemporal_det.py

Reproduces the problem - error message

No response

Additional information

No response

ao-zz commented 2 months ago

There are tow possible ways to solve it.

  1. Change model's load order, see here
  2. Update cfg to make mmdet fit in mmpose's scope, see here. // This works for me