IFMedTechdemo commited on
Commit
2c610b9
·
verified ·
1 Parent(s): 4f87922

Upload models/backbone.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. models/backbone.py +1 -1
models/backbone.py CHANGED
@@ -185,7 +185,7 @@ def build_backbone(args):
185
  'swin_L_384_22k': 'swin_large_patch4_window12_384_22k.pth',
186
  }
187
  pretrainedpath = os.path.join(pretrained_dir, PTDICT[args.backbone])
188
- checkpoint = torch.load(pretrainedpath, map_location='cpu')['model']
189
  from collections import OrderedDict
190
  def key_select_function(keyname):
191
  if 'head' in keyname:
 
185
  'swin_L_384_22k': 'swin_large_patch4_window12_384_22k.pth',
186
  }
187
  pretrainedpath = os.path.join(pretrained_dir, PTDICT[args.backbone])
188
+ checkpoint = torch.load(pretrainedpath, map_location='cpu', weights_only=False)['model']
189
  from collections import OrderedDict
190
  def key_select_function(keyname):
191
  if 'head' in keyname: