Skip to content

Commit a06bf4d

Browse files
authored
Merge pull request open-mmlab#2304 from xiexinch/fix_swin_load
[Fix] Fix swin load state_dict
2 parents a39b16f + 26e9729 commit a06bf4d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mmseg/models/backbones/swin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from mmengine.model import BaseModule, ModuleList
1414
from mmengine.model.weight_init import (constant_init, trunc_normal_,
1515
trunc_normal_init)
16-
from mmengine.runner import CheckpointLoader, load_state_dict
16+
from mmengine.runner import CheckpointLoader
1717
from mmengine.utils import to_2tuple
1818

1919
from mmseg.registry import MODELS
@@ -732,7 +732,7 @@ def init_weights(self):
732732
nH2, L2).permute(1, 0).contiguous()
733733

734734
# load state_dict
735-
load_state_dict(self, state_dict, strict=False, logger=None)
735+
self.load_state_dict(state_dict, strict=False)
736736

737737
def forward(self, x):
738738
x, hw_shape = self.patch_embed(x)

0 commit comments

Comments
 (0)