Skip to content

Commit b16fdcc

Browse files
committed
feat(ppsci): support data_effient_nopt
1 parent 6bcaa21 commit b16fdcc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/data_efficient_nopt/pretrain_basic.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,13 +306,14 @@ def restore_checkpoint(self, checkpoint_path):
306306
name = key[7:]
307307
new_state_dict[name] = val
308308
self.model.set_state_dict(new_state_dict)
309-
self.iters = checkpoint["iters"]
309+
310310
if (
311311
self.params.resuming
312312
): # restore checkpoint is used for finetuning as well as resuming. If finetuning (i.e., not resuming), restore checkpoint does not load optimizer state, instead uses config specified lr.
313313
self.optimizer.set_state_dict(checkpoint["optimizer_state_dict"])
314314
self.startEpoch = checkpoint["epoch"]
315315
self.epoch = self.startEpoch
316+
self.iters = checkpoint["iters"]
316317
else:
317318
self.iters = 0
318319
checkpoint = None

0 commit comments

Comments
 (0)