open-mmlab / mmdetection

OpenMMLab Detection Toolbox and Benchmark
https://mmdetection.readthedocs.io
Apache License 2.0
29.55k stars 9.46k forks source link

KeyError: 'model' #11635

Open ghfSlience opened 6 months ago

ghfSlience commented 6 months ago

“grounding_dino_swin-t_pretrain_obj365_goldg_grit9m_v3det_20231204_095047-b448804b.pth”。This model cannot be used in the official demo code of Grounded Dino。An error is reported when running the code:KeyError: 'model'

XiaoSiJi-GCY commented 1 month ago

I have encountered the same problem as you, does anyone know how to solve it

XiaoSiJi-GCY commented 1 month ago

""" D:\AcademicResearch\PaperCode\MMCV_tutorials\mmdetection-main\data\coco\val2017\2.jpg D:\AcademicResearch\PaperCode\MMCV_tutorials\mmdetection-main\tools\work_dirs\deformable-detr_r50_16xb2-50e_coco\my20240918_deformable-detr_r50_16xb2-50e_coco.py D:\AcademicResearch\PaperCode\MMCV_tutorials\mmdetection-main\tools\work_dirs\deformable-detr_r50_16xb2-50e_coco\latest.pth """ def parse_args(): parser = ArgumentParser() parser.add_argument(

'inputs', type=str, help='Input image file or folder path.')

    'inputs',
    type=str,
    help='Input image file or folder path.')
parser.add_argument(
    'model',
    type=str,
    help='Config or checkpoint .pth file or the model name '
    'and alias defined in metafile. The model configuration '
    'file will try to read from .pth if the parameter is '
    'a .pth weights file.')
parser.add_argument('--weights',
                    default=None,
                    help='Checkpoint file')

貌似不需要直接改动‘inputs’、‘model’和‘--weights’,这样就不会报错KeyError: 'model'