Skip to content

Commit

Permalink
support loading deit weights (#538)
Browse files Browse the repository at this point in the history
  • Loading branch information
谢昕辰 authored May 9, 2021
1 parent db44d16 commit 584f5a7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 2 additions & 0 deletions mmseg/models/backbones/vit.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,8 @@ def init_weights(self, pretrained=None):
checkpoint = _load_checkpoint(pretrained, logger=logger)
if 'state_dict' in checkpoint:
state_dict = checkpoint['state_dict']
elif 'model' in checkpoint:
state_dict = checkpoint['model']
else:
state_dict = checkpoint

Expand Down
1 change: 0 additions & 1 deletion mmseg/models/necks/multilevel_neck.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def __init__(self,

def forward(self, inputs):
assert len(inputs) == len(self.in_channels)
print(inputs[0].shape)
inputs = [
lateral_conv(inputs[i])
for i, lateral_conv in enumerate(self.lateral_convs)
Expand Down

0 comments on commit 584f5a7

Please sign in to comment.