mmsegmentation icon indicating copy to clipboard operation
mmsegmentation copied to clipboard

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

Open heorhiikalaichev opened this issue 1 year ago • 4 comments

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'

heorhiikalaichev avatar Sep 01 '23 15:09 heorhiikalaichev

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

jinxianwei avatar Sep 21 '23 02:09 jinxianwei

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

nitec427 avatar Nov 29 '23 20:11 nitec427

what is the mmengine version

jinxianwei avatar Nov 30 '23 01:11 jinxianwei

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?

jinxianwei avatar Nov 30 '23 01:11 jinxianwei