-
Notifications
You must be signed in to change notification settings - Fork 71
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
Adds resuming and saving model to sb3 example #135
Conversation
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.
Nice, looking good! I haven't had time to test it though.
|
||
parser.add_argument( | ||
"--timesteps", | ||
default=1_000_000, |
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.
oh nice!
"remove the folder containing the checkpoints. ") | ||
|
||
if args.inference and args.resume_model_path is None: | ||
raise parser.error("Using --inference requires --resume_model_path to be set.") |
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.
Nice even with proper error handling. ❤️
Co-authored-by: Florentin Luca Rieger <[email protected]>
Thanks for the review. I ran a quick test on it in which it worked, but I didn't test every use case in-depth. |
@@ -21,34 +24,114 @@ | |||
"--experiment_dir", | |||
default="logs/sb3", | |||
type=str, | |||
help="The name of the experiment directory, in which the tensorboard logs are getting stored", | |||
help="The name of the experiment directory, in which the tensorboard logs and checkpoints (if enabled) are getting stored." |
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.
small nit, can the default experiment_name
be lower case, "experiment"?
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.
This is great! Maybe we could expose the show_window
parameter, in other scripts I have this option as --viz
. I think training can be faster if you don't render. (but obviously you can't see the agent's progress)
Otherwise LGTM feel free to merge.
Co-authored-by: Florentin Luca Rieger <[email protected]>
Thank you for the review, I agree. Camera sensors may need Will merge after all tests pass. |
Adds the ability to save and load model for resuming training, run inference and save periodic checkpoints with CL arguments.
Limitations of this implementation:
For example, if using the default arguments (no exp dir or name specified), the logs will be saved to:
.\logs\sb3\Experiment_1
and checkpoints will be saved to:
.\logs\sb3\Experiment_checkpoints
--timesteps=10_000
and saving a model, then resuming training with the same setting and saving the model again will train the model for20_000
total timesteps, but10_000
steps will be displayed in the console log after the final training run.This is just a draft implementation, I welcome your feedback on whether it is sufficient as specified before starting changes to the documentation.