Skip to content

Commit 4b218bc

Browse files
authored
[Fix] Fix ATTENTION registry (open-mmlab#729)
* register ATTENTION registry from the parent ATTENTION registry of MMCV to avoid conflict with other repos * remove redundant file
1 parent 58c9ac0 commit 4b218bc

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

mmseg/models/backbones/swin.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import torch.nn as nn
66
import torch.nn.functional as F
77
from mmcv.cnn import build_norm_layer, trunc_normal_init
8-
from mmcv.cnn.bricks.registry import ATTENTION
98
from mmcv.cnn.bricks.transformer import FFN, build_dropout
109
from mmcv.cnn.utils.weight_init import constant_init
1110
from mmcv.runner import _load_checkpoint
@@ -15,7 +14,7 @@
1514
from torch.nn.modules.utils import _pair as to_2tuple
1615

1716
from ...utils import get_root_logger
18-
from ..builder import BACKBONES
17+
from ..builder import ATTENTION, BACKBONES
1918
from ..utils import PatchEmbed, swin_convert
2019

2120

mmseg/models/builder.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import warnings
22

33
from mmcv.cnn import MODELS as MMCV_MODELS
4+
from mmcv.cnn.bricks.registry import ATTENTION as MMCV_ATTENTION
45
from mmcv.utils import Registry
56

67
MODELS = Registry('models', parent=MMCV_MODELS)
8+
ATTENTION = Registry('attention', parent=MMCV_ATTENTION)
79

810
BACKBONES = MODELS
911
NECKS = MODELS

0 commit comments

Comments
 (0)