MCPcopy Create free account
hub / github.com/10Ring/LAA-Net / load_pretrained

Function load_pretrained

models/utils.py:43–50  ·  view source on GitHub ↗

This function only care about state dict of model For other modules such as optimizer, resume learning, please refer @load_model

(model, weight_path)

Source from the content-addressed store, hash-verified

41
42
43def load_pretrained(model, weight_path):
44 '''
45 This function only care about state dict of model
46 For other modules such as optimizer, resume learning, please refer @load_model
47 '''
48 state_dict = torch.load(weight_path)['state_dict']
49 model.load_state_dict(state_dict, strict=True)
50 return model
51
52
53def freeze_backbone(cfg, model):

Callers 2

mainFunction · 0.90
test.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected