open-mmlab / mmsegmentation

OpenMMLab Semantic Segmentation Toolbox and Benchmark.
https://mmsegmentation.readthedocs.io/en/main/
Apache License 2.0
7.7k stars 2.53k forks source link

KeyError: "EncoderDecoder: 'XX is not in the models registry'" #3304

Open heorhiikalaichev opened 10 months ago

heorhiikalaichev commented 10 months ago

Hi!

I'm trying to train my segmentation model with my own model. I model code I add

@BACKBONES.register_module() class FastViT(nn.Module):

But I still have the same error

KeyError: "EncoderDecoder: 'FastViT is not in the models registry'".

Traceback (most recent call last): File "/home/paperspace/miniconda3/envs/mmcv_env/lib/python3.7/site-packages/mmcv/utils/registry.py", line 52, in build_from_cfg return obj_cls(*args) File "/home/paperspace/miniconda3/envs/mmcv_env/lib/python3.7/site-packages/mmseg/models/segmentors/encoder_decoder.py", line 36, in init self.backbone = builder.build_backbone(backbone) File "/home/paperspace/miniconda3/envs/mmcv_env/lib/python3.7/site-packages/mmseg/models/builder.py", line 20, in build_backbone return BACKBONES.build(cfg) File "/home/paperspace/miniconda3/envs/mmcv_env/lib/python3.7/site-packages/mmcv/utils/registry.py", line 215, in build return self.build_func(args, **kwargs, registry=self) File "/home/paperspace/miniconda3/envs/mmcv_env/lib/python3.7/site-packages/mmcv/cnn/builder.py", line 27, in build_model_from_cfg return build_from_cfg(cfg, registry, default_args) File "/home/paperspace/miniconda3/envs/mmcv_env/lib/python3.7/site-packages/mmcv/utils/registry.py", line 45, in build_from_cfg f'{obj_type} is not in the {registry.name} registry') KeyError: 'FastViT is not in the models registry'

jinxianwei commented 9 months ago

Hi!

I'm trying to train my segmentation model with my own model. I model code I add

@BACKBONES.register_module() class FastViT(nn.Module):

But I still have the same error

KeyError: "EncoderDecoder: 'FastViT is not in the models registry'".

Traceback (most recent call last): File "/home/paperspace/miniconda3/envs/mmcv_env/lib/python3.7/site-packages/mmcv/utils/registry.py", line 52, in build_from_cfg return obj_cls(args) File "/home/paperspace/miniconda3/envs/mmcv_env/lib/python3.7/site-packages/mmseg/models/segmentors/encoder_decoder.py", line 36, in init* self.backbone = builder.build_backbone(backbone) File "/home/paperspace/miniconda3/envs/mmcv_env/lib/python3.7/site-packages/mmseg/models/builder.py", line 20, in build_backbone return BACKBONES.build(cfg) File "/home/paperspace/miniconda3/envs/mmcv_env/lib/python3.7/site-packages/mmcv/utils/registry.py", line 215, in build return self.build_func(args, **kwargs, registry=self) File "/home/paperspace/miniconda3/envs/mmcv_env/lib/python3.7/site-packages/mmcv/cnn/builder.py", line 27, in build_model_from_cfg return build_from_cfg(cfg, registry, default_args) File "/home/paperspace/miniconda3/envs/mmcv_env/lib/python3.7/site-packages/mmcv/utils/registry.py", line 45, in build_from_cfg f'{obj_type} is not in the {registry.name} registry') KeyError: 'FastViT is not in the models registry'

  1. install form source image
  2. add decorator image
  3. add model in init.py image

you can try this

nitec427 commented 7 months ago

Hey I have the same problem and I installed it from the source. Here is the error traceback.

Screenshot 2023-11-29 at 23 55 47
jinxianwei commented 7 months ago

what is the mmengine version

jinxianwei commented 7 months ago

Hey I have the same problem and I installed it from the source. Here is the error traceback. Screenshot 2023-11-29 at 23 55 47

what is the mmengine version?