-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add checkpoint #945
base: master
Are you sure you want to change the base?
add checkpoint #945
Conversation
args.iteration = load_checkpoint(model, optimizer, opt_param_scheduler) | ||
else: | ||
args.iteration = 0 | ||
|
||
args.iteration = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete this line. Otherwise, the args.iteration
is wrong if the checkpoint is successfully loaded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, do we need to change args.train_iters
? args.iteration
may be larger than args.train_iters
if there is a checkpoint.
@@ -503,6 +509,8 @@ def load_checkpoint(model, optimizer, opt_param_scheduler, load_arg='load', stri | |||
load_dir = getattr(args, load_arg) | |||
|
|||
model = unwrap_model(model) | |||
model_module = model.module | |||
model = [model_module] | |||
|
|||
state_dict, checkpoint_name, release = _load_base_checkpoint(load_dir, rank0=False) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no exit_on_missing_checkpoint
argument now. It will produce the following error if one has argument load
but no checkpoint.
[rank1]: if not args.exit_on_missing_checkpoint:
[rank1]: AttributeError: 'Namespace' object has no attribute 'exit_on_missing_checkpoint'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as expected. I have one question I'd like to confirm. Do we need to save the status of data loader to avoid reusing data samples?
support checkpoint for domino