Open yCobanoglu opened 1 year ago
If i clone the complete repo then i can get it to work. But how can i use the configs from this repo without having to clone the complete repo. I want to install mmdet in .venv and use the configs from the config folder.
You can set _base_ = "mmdet::mask_rcnn/mask_rcnn_r50_fpn_1x_coco.py"
I also have a similar problem. System environment: MMEngine: 0.7.0,MMCV: 2.0.0rc4,MMDet: 3.0.0rc6
-mmengine - WARNING - Failed to import mmdet.models, please check the location of the registry model is correct.
Traceback (most recent call last):
File "/home/../tools/train.py", line 124, in FasterRCNN
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'
FasterRCNN and MaskRCNN both reported the same error.
I also have a similar problem. System environment: MMEngine: 0.7.0,MMCV: 2.0.0rc4,MMDet: 3.0.0rc6
-mmengine - WARNING - Failed to import mmdet.models, please check the location of the registry model is correct. Traceback (most recent call last): File "/home/../tools/train.py", line 124, in main() File "/home/../tools/train.py", line 113, in main runner = Runner.from_cfg(cfg) File "/home/./anaconda3/lib/python3.9/site-packages/mmengine/runner/runner.py", line 439, in from_cfg runner = cls( File "/home/./anaconda3/lib/python3.9/site-packages/mmengine/runner/runner.py", line 406, in init self.model = self.build_model(model) File "/home/./anaconda3/lib/python3.9/site-packages/mmengine/runner/runner.py", line 808, in build_model model = MODELS.build(model) File "/home/./anaconda3/lib/python3.9/site-packages/mmengine/registry/registry.py", line 548, in build return self.build_func(cfg, *args, **kwargs, registry=self) File "/home/./anaconda3/lib/python3.9/site-packages/mmengine/registry/build_functions.py", line 241, in build_model_from_cfg return build_from_cfg(cfg, registry, default_args) File "/home/./anaconda3/lib/python3.9/site-packages/mmengine/registry/build_functions.py", line 100, in build_from_cfg raise KeyError( KeyError: 'FasterRCNN is not in the model registry. Please check whether the value of
FasterRCNN
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'FasterRCNN and MaskRCNN both reported the same error.
I seem to have resolved this issue, and all modules show that they have not been registered before resolving it. Just add it in tools/train.py:
from mmdet.utils import register_all_modules register_all_modules()
I encountered the same error. In my case, the following description was missing from the config file. So I added it to the config file. That fixed it.
default_scope = 'mmdet'
I encountered the same error. In my case, the following description was missing from the config file. So I added it to the config file. That fixed it.
default_scope = 'mmdet'
I also realized that
I saw this when accidentally running an mmdet 2.x config (probably due to the missing default_scope)
what about new register a model ?遇到同样的问题,
Prerequisite
Task
I'm using the official example scripts/configs for the officially supported tasks/models/datasets.
Branch
master branch https://github.com/open-mmlab/mmdetection version 3.0.0
Environment
""
Reproduces the problem - code sample
my folder structure:
.venv src/ src/mmdetection/configs # here all configs from master branch copied src/mmdetection/custom_configs #here is my custom config file used for training src/mmdetection/tools/train.py #train.py from master 3.0 branch
custom_config.py
_base_ has absolute path to config file
Also the
train.py
is broken.env_cfg=cfg.get('env_cfg')
has to beenv_cfg=cfg.get('env_cfg', {})
Reproduces the problem - command or script
""
Reproduces the problem - error message
Additional information
No response