Allow fail_state_trials show warning when heartbeat is enabled#3301
Merged
HideakiImamura merged 2 commits intooptuna:masterfrom Feb 9, 2022
Merged
Allow fail_state_trials show warning when heartbeat is enabled#3301HideakiImamura merged 2 commits intooptuna:masterfrom
fail_state_trials show warning when heartbeat is enabled#3301HideakiImamura merged 2 commits intooptuna:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3301 +/- ##
==========================================
- Coverage 91.76% 91.73% -0.03%
==========================================
Files 146 146
Lines 12091 12089 -2
==========================================
- Hits 11095 11090 -5
- Misses 996 999 +3
Continue to review full report at Codecov.
|
Member
Author
|
@HideakiImamura PTAL. cc. @hvy |
HideakiImamura
added a commit
to HideakiImamura/optuna
that referenced
this pull request
Feb 9, 2022
Allow `fail_state_trials` show warning when heartbeat is enabled
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the current latest alpha release, the same warning message is displayed repeatedly, which is not intentional.
This behavior seemingly comes from the known issue of
warnings.catch_warnings, which was reported in https://bugs.python.org/issue29672.Invoking
warnings.catch_warningshas a side-effect, and it would be better not to invoke it for not only Optuna but also the library users. So, in this PR, I removecatch_warningsin_run_trialand check if heartbeat is enabled by the user instead.Motivation
Stop showing a warning repeatedly.
Description of the changes
catch_warningsand check if heartbeat is enabledBefore
After