Skip to content

Commit 601f05b

Browse files
author
实一
committed
update
1 parent 77b447e commit 601f05b

File tree

2 files changed

+1
-58
lines changed

2 files changed

+1
-58
lines changed

trainer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ def load_checkpoint(
501501

502502
# load model parameters
503503
try:
504-
if "use_ema_weights_to_init_param" in self.cfg.checkpoint and self.cfg.checkpoint.use_ema_weights_to_init_param and "extra_state" in state and "ema" in state["extra_state"]:
504+
if getattr(self.cfg.checkpoint, "use_ema_weights_to_init_param", None) and "extra_state" in state and "ema" in state["extra_state"]:
505505
logger.info("use_ema_weights_to_init_param = True, will use EMA weights in the ckpt to init the model param...")
506506
ema_state_dict = state["extra_state"]["ema_fp32_params"] if "ema_fp32_params" in state["extra_state"] else state["extra_state"]["ema"]
507507
self.model.load_state_dict(

utils/albef_utils.py

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)