Skip to content
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

Added submenu for simpler loading of pre-trained models #105

Merged
merged 1 commit into from
Jan 7, 2021

Conversation

dribnet
Copy link
Contributor

@dribnet dribnet commented Jan 3, 2021

Added a small sub-routine that scans for previously
saved models. These can be loaded by simply selecting
the menu option instead of providing the full path.
The menu is presented in reverse chronological order
and the final option "Specify paths manually" preserves
the ability to provide a full path for the checkpoint
and replay buffer as was done previously.

This is probably best understood by looking at an example. Showing user input in bold, previously the UI flow for loading a model was:

0. Train
1. Load pretrained model
2. Diagnose model
3. Render some self play games
4. Play against MuZero
5. Test the game manually
6. Hyperparameter search
7. Exit
Enter a number to choose an action: 1
Enter a path to the model.checkpoint, or ENTER if none: results/cartpole/2020-12-28--21-53-13/model.checkpoint
Enter a path to the replay_buffer.pkl, or ENTER if none: results/cartpole/2020-12-28--21-53-13/replay_buffer.pkl

Using checkpoint from results/cartpole/2020-12-28--21-53-13/model.checkpoint
Initializing replay buffer with results/cartpole/2020-12-28--21-53-13/replay_buffer.pkl
Done

And after changes it becomes:

0. Train
1. Load pretrained model
2. Diagnose model
3. Render some self play games
4. Play against MuZero
5. Test the game manually
6. Hyperparameter search
7. Exit
Enter a number to choose an action: 1

0. results/cartpole/2021-01-03--01-53-29/
1. results/cartpole/2020-12-28--21-59-16/
2. results/cartpole/2020-12-28--21-58-40/
3. results/cartpole/2020-12-28--21-53-13/
4. Specify paths manually
Enter a number to choose a model to load: 0

Using checkpoint from results/cartpole/2021-01-03--01-53-29/model.checkpoint
Initializing replay buffer with results/cartpole/2021-01-03--01-53-29/replay_buffer.pkl
Done

Just an idea, no worries if you don't want to merge this into master as I can also appreciate a dead simple demo program.

Added a small sub-routine that scans for previously
saved models. These can be loaded by simply selecting
the menu option instead of providing the full path.
The menu is presented in reverse chronological order
and the final option "Specify paths manually" preserves
the ability to provide a full path for the checkpoint
and replay buffer as was done previously.
Copy link
Owner

@werner-duvaud werner-duvaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks !

@werner-duvaud werner-duvaud merged commit e20e6bd into werner-duvaud:master Jan 7, 2021
egafni pushed a commit to egafni/muzero-general that referenced this pull request Apr 15, 2021
…d#105)

Added a small sub-routine that scans for previously
saved models. These can be loaded by simply selecting
the menu option instead of providing the full path.
The menu is presented in reverse chronological order
and the final option "Specify paths manually" preserves
the ability to provide a full path for the checkpoint
and replay buffer as was done previously.
EpicLiem pushed a commit to EpicLiem/muzero-general-chess-archive that referenced this pull request Feb 4, 2023
…d#105)

Added a small sub-routine that scans for previously
saved models. These can be loaded by simply selecting
the menu option instead of providing the full path.
The menu is presented in reverse chronological order
and the final option "Specify paths manually" preserves
the ability to provide a full path for the checkpoint
and replay buffer as was done previously.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants