121 words
1 minute
MMDetection 注册表 KeyError 排查
问题
即便是上传代码且运行一下指令安装后:
pip install --no-build-isolation . --force-reinstall --no-deps也报错:
KeyError: ‘YOLA_Transformer is not in the mmdet::model registry. Please check whether the value of YOLA_Transformer 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’

解决方案
在配置文件添加 MMDetection 官方推荐的 custom_imports,而不修改mmdet: # 自定义模块导入(MMDetection 官方推荐方式) custom_imports = dict( imports=['mmdet.models.detectors.yola_wavelet'], allow_failed_imports=False )参考链接
MMDetection官方文档
自定义模型与配置文件
MMDetection 注册表 KeyError 排查
/blog/posts/成长日记/深度学习/mmdet-registry-error/ Some information may be outdated