Skip to content

Commit

Permalink
[Fix] Use local ATTENTION registery to avoid conflict with other repo. (
Browse files Browse the repository at this point in the history
  • Loading branch information
mzr1996 authored Jul 27, 2021
1 parent 2c22a62 commit ecabf98
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions mmcls/models/builder.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from mmcv.cnn import MODELS as MMCV_MODELS
from mmcv.cnn.bricks.registry import ATTENTION as MMCV_ATTENTION
from mmcv.utils import Registry

MODELS = Registry('models', parent=MMCV_MODELS)
Expand All @@ -9,6 +10,8 @@
LOSSES = MODELS
CLASSIFIERS = MODELS

ATTENTION = Registry('attention', parent=MMCV_ATTENTION)


def build_backbone(cfg):
"""Build backbone."""
Expand Down
2 changes: 1 addition & 1 deletion mmcls/models/utils/attention.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn.bricks.registry import ATTENTION
from mmcv.cnn.bricks.transformer import build_dropout
from mmcv.cnn.utils.weight_init import trunc_normal_
from mmcv.runner.base_module import BaseModule

from ..builder import ATTENTION
from .helpers import to_2tuple


Expand Down

0 comments on commit ecabf98

Please sign in to comment.