Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: "MaskRCNN: 'RefineRoIHead is not in the models registry'" #5974

Closed
apanand14 opened this issue Aug 30, 2021 · 8 comments
Closed

KeyError: "MaskRCNN: 'RefineRoIHead is not in the models registry'" #5974

apanand14 opened this issue Aug 30, 2021 · 8 comments
Assignees

Comments

@apanand14
Copy link

apanand14 commented Aug 30, 2021

Hello,

I'm new to mmdetection. I installed mmcv and mmdetection successfully on my windows. But When I train refine mask I'm getting this particular key error (which is mentioned in title). Please help me to solve this error and run successfully refine mask.
https://github.com/zhanggang001/RefineMask

Traceback (most recent call last):
File "tools/train.py", line 153, in
main()
File "tools/train.py", line 126, in main
cfg.model, train_cfg=cfg.train_cfg, test_cfg=cfg.test_cfg)
File "C:\AI\RefineMask\venv\lib\site-packages\mmdet\models\builder.py", line 58, in build_detector
cfg, default_args=dict(train_cfg=train_cfg, test_cfg=test_cfg))
File "C:\AI\RefineMask\venv\lib\site-packages\mmcv\utils\registry.py", line 212, in build
return self.build_func(*args, **kwargs, registry=self)
File "C:\AI\RefineMask\venv\lib\site-packages\mmcv\cnn\builder.py", line 27, in build_model_from_cfg
return build_from_cfg(cfg, registry, default_args)
File "C:\AI\RefineMask\venv\lib\site-packages\mmcv\utils\registry.py", line 55, in build_from_cfg
raise type(e)(f'{obj_cls.name}: {e}')
KeyError: "MaskRCNN: 'RefineRoIHead is not in the models registry'"

@BIGWangYuDong
Copy link
Collaborator

Hi, maybe you should check your environment.
Maybe you have installed the mmdet in another folder. You can try to install mmdet under your folder,( use pip install -v -e . to install mmdet in your folder)

@apanand14
Copy link
Author

Hey, I have installed properly in the same folder. Basically I'm adding custom refine_mask_head.py in models/maskheads and also refine_roi_head.py in roi_heads. I made changes accordingly. Also using '@HEADS.register_module()' as discussed in mmdet documentation under customized models. Still do not know what is the issue of registry I'm facing. Can you tell me if you know more about this? Thank you in advance.

@ZwwWayne
Copy link
Collaborator

ZwwWayne commented Sep 7, 2021

Because the file is not imported. You need to update the corresponding __init__.py or use custom_imports in your config. See examples in https://mmdetection.readthedocs.io/en/latest/tutorials/customize_models.html#import-the-module

@apanand14
Copy link
Author

Thank you for your response. I have sucessfully resolved the issue.

@akaRainbowShine
Copy link

Thank you for your response. I have sucessfully resolved the issue.

i have the same issue, could you show me the solution?

@Kerwin0621
Copy link

run: “pip install -v -e . " in your terminal, then solved

@xjq1042523740
Copy link

因为文件没有导入。您需要更新相应的__init__.py或在配置中使用 custom_imports 。请参阅https://mmdetection.readthedocs.io/en/latest/tutorials/customize_models.html#import-the-module中的示例

Because the file is not imported. You need to update the corresponding __init__.py or use custom_imports in your config. See examples in https://mmdetection.readthedocs.io/en/latest/tutorials/customize_models.html#import-the-module

Hello, this link is invalid, can you send it again?

@nskostas
Copy link
Contributor

nskostas commented Jul 21, 2023

因为文件没有导入。您需要更新相应的__init__.py或在配置中使用 custom_imports 。请参阅https://mmdetection.readthedocs.io/en/latest/tutorials/customize_models.html#import-the-module中的示例

Because the file is not imported. You need to update the corresponding init.py or use custom_imports in your config. See examples in https://mmdetection.readthedocs.io/en/latest/tutorials/customize_models.html#import-the-module

Hello, this link is invalid, can you send it again?

Hi, I think this is the updated link, but someone from the team could confirm. Thanks https://mmengine.readthedocs.io/en/latest/advanced_tutorials/config.html#import-the-custom-module

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants