xingyizhou / CenterNet2

Two-stage CenterNet
Apache License 2.0
1.2k stars 188 forks source link

Import add_centernet_config from config.py to __init__.py #76

Open SahilChachra opened 2 years ago

SahilChachra commented 2 years ago

While using CenterNet2 in Detectron2, if add_centernet_config is not imported to init.py, it gives - KeyError: 'Non-existent config key: MODEL.ROI_BOX_HEAD.MULT_PROPOSAL_SCORE'.

As per other projects under Detectron2 (for example - panoptic_deeplab), we can see that init.py imports add_panoptic_deeplab_config from its own config.py and then we call add_panoptic_deeplab_config and pass the YAML path to this function.

In the case of panoptic_deeplab,

from detectron2.projects import panoptic_deeplab
panoptic_deeplab.add_panoptic_deeplab_config (cfg_path)

Since 'add_centernet_config' was missing from centernet's init.py , I added it and the error was resolved.