LOADING
121 words
1 minute
MMDetection 注册表 KeyError 排查

问题#

即便是上传代码且运行一下指令安装后:

Terminal window
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

image-20260117090247687

解决方案#

在配置文件添加 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/
Author
Zenfish
Published at
2026-02-05
License
CC BY-NC-SA 4.0

Some information may be outdated