keras-tuner
keras-tuner copied to clipboard
Continuing the search does not update the trial number in the log
When I want to continue an hyperparameter search with tuner.search()
, the log that is printed as output starts from 1 instead from the number of the last trial + 1.
For example, I arrived at Trial 23, but after initializing the tuner with the same directory
and project
, it says: Search: Running Trial #1
, instead of Search: Running Trial #24
.
However, the tuner is able to load the best trial among the last 23, so the state of the searching process is preserved.
This is a minor issue, but I wanted to let you know. Thanks
Hello @haifeng-jin, I would like to work on this issue.
I've gone through the source code and here's how I feel I could start. As the _set_project_dir() function sets the directory and reloads the oracle, the number of previously stored trials can be saved and be used as the trial_number in the display function rather than reinitializing every time the tuner is initialized.
Thank you.
@vardhanaleti Thank you for taking this issue.
I haven't really dig into the cause of this bug yet. But for it to work as expected, we should be able to get the number trials from a loaded oracle and the display function should just accept that normally from the oracle (directly or indirectly) as normal.
Absolutely, I've edited and ran it accordingly and it works as expected. Before making a PR, I'm going through the contribution guidelines and setting the right environment for testing as I'm new to making contributions. Thank you.