Skip to content

Commit

Permalink
Merge pull request open-mmlab#2304 from xiexinch/fix_swin_load
Browse files Browse the repository at this point in the history
[Fix] Fix swin load state_dict
  • Loading branch information
MeowZheng committed Nov 15, 2022
2 parents 5ea8edc + 8aaecd3 commit 840edfc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mmseg/models/backbones/swin.py
Expand Up @@ -13,7 +13,7 @@
from mmengine.model import BaseModule, ModuleList
from mmengine.model.weight_init import (constant_init, trunc_normal_,
trunc_normal_init)
from mmengine.runner import CheckpointLoader, load_state_dict
from mmengine.runner import CheckpointLoader
from mmengine.utils import to_2tuple

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

# load state_dict
load_state_dict(self, state_dict, strict=False, logger=None)
self.load_state_dict(state_dict, strict=False)

def forward(self, x):
x, hw_shape = self.patch_embed(x)
Expand Down

0 comments on commit 840edfc

Please sign in to comment.