Skip to content

mmdet SwinTransformer parameter problem #58

Description

@pwner-web

The parameters supported by almost all versions of mmdet SwinTransformer are as follows:

(pretrain_img_size=224, in_channels=3, embed_dims=96, patch_size=4, window_size=7, mlp_ratio=4, depths=(2, 2, 6, 2), num_heads=(3, 6, 12, 24), strides=(4, 2, 2, 2), out_indices=(0, 1, 2, 3), qkv_bias=True, qk_scale=None, patch_norm=True, drop_rate=0.0, attn_drop_rate=0.0, drop_path_rate=0.1, use_abs_pos_embed=False, act_cfg={'type': 'GELU'}, norm_cfg={'type': 'LN'}, with_cp=False, pretrained=None, convert_weights=False, frozen_stages=-1, init_cfg=None)

However, the parameters in the code are:

backbone=dict(
embed_dims=96,
depths=[2, 2, 6, 2],
num_heads=[3, 6, 12, 24],
window_size=7,
ape=False,
drop_path_rate=0.0,
patch_norm=True,
use_checkpoint=False
)

This resulted in many of the following errors:

Traceback (most recent call last):
File "/home/inspur/Software/anaconda3/envs/autohic/lib/python3.9/site-packages/mmcv/utils/registry.py", line 69, in build_from_cfg
return obj_cls(**args)
TypeError: init() got an unexpected keyword argument 'embed_dim'

Traceback (most recent call last):
File "/home/inspur/Software/anaconda3/envs/autohic/lib/python3.9/site-packages/mmcv/utils/registry.py", line 69, in build_from_cfg
return obj_cls(**args)
TypeError: init() got an unexpected keyword argument 'ape'

I would like to inquire about the mmdet version information used by the author.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions