MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / load_state_model

Function load_state_model

PATH/core/utils.py:204–216  ·  view source on GitHub ↗
(model, state, ginfo)

Source from the content-addressed store, hash-verified

202
203
204def load_state_model(model, state, ginfo):
205 if ginfo.task_rank == 0:
206 printlog(f'======= loading model state for task {ginfo.task_id} ... =======')
207
208 msg = model.load_state_dict(state, strict=False)
209
210 state_keys = set(state.keys())
211 model_keys = set(model.state_dict().keys())
212 missing_keys = model_keys - state_keys
213 if ginfo.task_rank == 0:
214 for k in missing_keys:
215 printlog(f'missing key: {k}')
216 printlog(f'load msg: {msg}')
217
218
219def load_state_optimizer(optimizer, state, ginfo):

Callers 3

loadMethod · 0.90
loadMethod · 0.90
loadMethod · 0.90

Calls 3

printlogFunction · 0.85
load_state_dictMethod · 0.80
state_dictMethod · 0.80

Tested by

no test coverage detected