ViT-Adapter icon indicating copy to clipboard operation
ViT-Adapter copied to clipboard

'BEiTAdapter is not in the models registry'

Open Haolin-Yuan opened this issue 2 years ago • 1 comments

Hi there,

I followed your instruction to run a training demo, but says 'BEiTAdapter is not in the models registry'. I tried to download pre-trained weights from the link you provided and also tried to us the link commented in the source code but none of them works. Could you please help? Thank you!

Here I print out the model config, and below shows the error message.

{'type': 'EncoderDecoder', 'pretrained': 'https://conversationhub.blob.core.windows.net/beit-share-public/beit/beit_large_patch16_224_pt22k_ft22k.pth', 'backbone': {'type': 'BEiTAdapter', 'patch_size': 16, 'embed_dim': 1024, 'depth': 24, 'num_heads': 16, 'mlp_ratio': 4, 'qkv_bias': True, 'use_abs_pos_emb': False, 'use_rel_pos_bias': True, 'img_size': 640, 'init_values': 1e-06, 'drop_path_rate': 0.3, 'conv_inplane': 64, 'n_points': 4, 'deform_num_heads': 16, 'cffn_ratio': 0.25, 'deform_ratio': 0.5, 'with_cp': True, 'interaction_indexes': [[0, 5], [6, 11], [12, 17], [18, 23]]}, 'decode_head': {'type': 'UPerHead', 'in_channels': [1024, 1024, 1024, 1024], 'in_index': [0, 1, 2, 3], 'pool_scales': (1, 2, 3, 6), 'channels': 1024, 'dropout_ratio': 0.1, 'num_classes': 150, 'norm_cfg': {'type': 'SyncBN', 'requires_grad': True}, 'align_corners': False, 'loss_decode': {'type': 'CrossEntropyLoss', 'use_sigmoid': False, 'loss_weight': 1.0}}, 'auxiliary_head': {'type': 'FCNHead', 'in_channels': 1024, 'in_index': 2, 'channels': 256, 'num_convs': 1, 'concat_input': False, 'dropout_ratio': 0.1, 'num_classes': 150, 'norm_cfg': {'type': 'SyncBN', 'requires_grad': True}, 'align_corners': False, 'loss_decode': {'type': 'CrossEntropyLoss', 'use_sigmoid': False, 'loss_weight': 0.4}}, 'train_cfg': {}, 'test_cfg': {'mode': 'slide', 'crop_size': (640, 640), 'stride': (426, 426)}} Traceback (most recent call last): File "/home/haolin/anaconda3/envs/ViT-Adapter/lib/python3.9/site-packages/mmcv/utils/registry.py", line 52, in build_from_cfg return obj_cls(**args) File "/home/haolin/anaconda3/envs/ViT-Adapter/lib/python3.9/site-packages/mmseg/models/segmentors/encoder_decoder.py", line 36, in init self.backbone = builder.build_backbone(backbone) File "/home/haolin/anaconda3/envs/ViT-Adapter/lib/python3.9/site-packages/mmseg/models/builder.py", line 20, in build_backbone return BACKBONES.build(cfg) File "/home/haolin/anaconda3/envs/ViT-Adapter/lib/python3.9/site-packages/mmcv/utils/registry.py", line 212, in build return self.build_func(*args, **kwargs, registry=self) File "/home/haolin/anaconda3/envs/ViT-Adapter/lib/python3.9/site-packages/mmcv/cnn/builder.py", line 27, in build_model_from_cfg return build_from_cfg(cfg, registry, default_args) File "/home/haolin/anaconda3/envs/ViT-Adapter/lib/python3.9/site-packages/mmcv/utils/registry.py", line 44, in build_from_cfg raise KeyError( KeyError: 'BEiTAdapter is not in the models registry'

Haolin-Yuan avatar Feb 17 '23 17:02 Haolin-Yuan

Hi, what's the version of mmseg and mmcv you used? And, could you show me the command you used for training.

czczup avatar Feb 18 '23 03:02 czczup