Open AdamSuperTramp opened 6 months ago
I have also encountered this bug, when migrating mmdet from 2.x to 3.x and mmseg from 0.x to 1.x
I have found solution in one of the issues: when you use difference mmlab frameworks for inference, use infer classes:
from mmdet.apis import DetInferencer
from mmseg.apis import MMSegInferencer
and etc.
Bug: Traceback (most recent call last): File "D:/Desktop/脚本/Adam-2训练&结果/加载3个模型/mmpose_predict_img.py", line 48, in
result = inference_model(model, img_bgr)
File "d:\desktop\science\model\mmsegmentation-main\mmseg\apis\inference.py", line 112, in inference_model
data, is_batch = _preprare_data(img, model)
File "d:\desktop\science\model\mmsegmentation-main\mmseg\apis\utils.py", line 29, in _preprare_data
pipeline = Compose(cfg.test_pipeline)
File "C:\Users\Adam\anaconda3\envs\mmlab\lib\site-packages\mmengine\dataset\base_dataset.py", line 38, in init
transform = TRANSFORMS.build(transform)
File "C:\Users\Adam\anaconda3\envs\mmlab\lib\site-packages\mmengine\registry\registry.py", line 570, in build
return self.build_func(cfg, *args, **kwargs, registry=self)
File "C:\Users\Adam\anaconda3\envs\mmlab\lib\site-packages\mmengine\registry\build_functions.py", line 100, in build_from_cfg
raise KeyError(
KeyError: 'PackSegInputs is not in the mmdet::transform registry. Please check whether the value of
PackSegInputs
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'The following lines are my code to predict images, including segment by Knet and estimator poses by RTMpose:
My guess:
If I use different model in mmlab at the same time, the later model(mmpose) will overridden the former model(Knet)