Skip to content

Commit

Permalink
[Fix] fix LSKNet error in import (#839)
Browse files Browse the repository at this point in the history
* fix lsknet

* fix some comment
  • Loading branch information
liuyanyi authored May 8, 2023
1 parent e3c87de commit b55be23
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions projects/LSKNet/lsknet/lsknet.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
import torch.nn as nn
from mmcv.cnn import build_norm_layer
from mmcv.cnn.bricks import DropPath
from mmcv.cnn.utils.weight_init import (constant_init, normal_init,
trunc_normal_init)
from mmcv.runner import BaseModule
from mmengine.model import (BaseModule, constant_init, normal_init,
trunc_normal_init)
from torch.nn.modules.utils import _pair as to_2tuple

from mmrotate.registry import MODELS
Expand All @@ -27,7 +26,7 @@ class Mlp(BaseModule):
Default: dict(type='GELU').
drop (float, optional): Probability of an element to be
zeroed in FFN. Default 0.0.
init_cfg (obj:`mmcv.ConfigDict`): The Config for initialization.
init_cfg (obj:`mmengine.ConfigDict`): The Config for initialization.
Default: None.
"""

Expand Down Expand Up @@ -62,7 +61,7 @@ class LSKmodule(BaseModule):
Args:
dim (int): Number of input channels.
init_cfg (obj:`mmcv.ConfigDict`): The Config for initialization.
init_cfg (obj:`mmengine.ConfigDict`): The Config for initialization.
Default: None.
"""

Expand Down Expand Up @@ -99,7 +98,7 @@ class Attention(BaseModule):
Args:
d_model (int): Number of input channels.
init_cfg (obj:`mmcv.ConfigDict`): The Config for initialization.
init_cfg (obj:`mmengine.ConfigDict`): The Config for initialization.
Default: None.
"""

Expand Down Expand Up @@ -132,9 +131,9 @@ class Block(BaseModule):
drop_path (float): Stochastic depth rate. Defaults to 0.1.
act_layer (dict, optional): The activation config for FFNs.
Default: dict(type='GELU').
norm_cfg (obj:`mmcv.ConfigDict`): The Config for normalization.
norm_cfg (obj:`mmengine.ConfigDict`): The Config for normalization.
Default: None.
init_cfg (obj:`mmcv.ConfigDict`): The Config for initialization.
init_cfg (obj:`mmengine.ConfigDict`): The Config for initialization.
Default: None.
"""

Expand Down Expand Up @@ -186,9 +185,9 @@ class OverlapPatchEmbed(BaseModule):
stride (int): OverlapPatchEmbed stride. Defaults to 4
in_chans (int): Number of input channels. Defaults to 3.
embed_dim (int): The hidden dimension of OverlapPatchEmbed.
norm_cfg (obj:`mmcv.ConfigDict`): The Config for normalization.
norm_cfg (obj:`mmengine.ConfigDict`): The Config for normalization.
Default: None.
init_cfg (obj:`mmcv.ConfigDict`): The Config for initialization.
init_cfg (obj:`mmengine.ConfigDict`): The Config for initialization.
Default: None.
"""

Expand Down

0 comments on commit b55be23

Please sign in to comment.