keras-tuner icon indicating copy to clipboard operation
keras-tuner copied to clipboard

Continuing the search does not update the trial number in the log

Open LucaUrbinati44 opened this issue 3 years ago • 3 comments

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

LucaUrbinati44 avatar Jun 14 '21 13:06 LucaUrbinati44

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 avatar Aug 19 '21 10:08 vardhanaleti

@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.

haifeng-jin avatar Aug 20 '21 07:08 haifeng-jin

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.

vardhanaleti avatar Aug 20 '21 07:08 vardhanaleti