Skip to content

Commit 584f5a7

Browse files
author
谢昕辰
authored
support loading deit weights (open-mmlab#538)
1 parent db44d16 commit 584f5a7

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

mmseg/models/backbones/vit.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,8 @@ def init_weights(self, pretrained=None):
325325
checkpoint = _load_checkpoint(pretrained, logger=logger)
326326
if 'state_dict' in checkpoint:
327327
state_dict = checkpoint['state_dict']
328+
elif 'model' in checkpoint:
329+
state_dict = checkpoint['model']
328330
else:
329331
state_dict = checkpoint
330332

mmseg/models/necks/multilevel_neck.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ def __init__(self,
5454

5555
def forward(self, inputs):
5656
assert len(inputs) == len(self.in_channels)
57-
print(inputs[0].shape)
5857
inputs = [
5958
lateral_conv(inputs[i])
6059
for i, lateral_conv in enumerate(self.lateral_convs)

0 commit comments

Comments
 (0)