forked from keras-team/keras
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BugFix of "AttributeError: 'ProgbarLogger' object has no attribute 't…
…arget'" (or 'log_values') error (keras-team#12898) (keras-team#12893) (keras-team#8944) This Change set is fixing two missing attribute bugs: * AttributeError: 'ProgbarLogger' object has no attribute 'target' keras-team#12898 Abstract reproduction scenario is provided in ticket * AttributeError: 'ProgbarLogger' object has no attribute 'log_values' keras-team#3657 * AttributeError: 'ProgbarLogger' object has no attribute 'log_values' keras-team#8944 (dup) Related changes: * Cases of regression are covered by tests. * Some potential bugs with same nature are prevented and covered by manifestation checks. * run with empty data array (but having valid shape) is now handled properly and yielding related warnings on callback and training routine level without execution fail Note: Changes that affect `ProgbarLogger` should be aware of following things: * proper target initialisation is requiring two attributes: `params` and `use_steps` to be defined * `use_steps` is guaranteed attribute the is set in the constructor (but could be altered after object instantiation. It's currently safe condition. * class `params` attribute could be altered between initialisation and training start. And current logic is made to be aware of this * we don't have `params` initialisation in constructor, this attribute will be assigned on call of `set_params` of base class somewhere on caller level (no strict guarantees :( ) * `seen` attribute is working in pair with `target` during `log_values` initialisation and their initialisation should be under the equal condition, currently thats not true * `if self.seen < self.target` condition is being checked whenever verbose mode value so both of them should be initialised without any conditions * `if self.seen < self.target` is checking for training iteration being not finished but in case of degenerate case with zero length it will not be called and `log_values` will stay not initialised but i don't see any explicit logic preventing using it on exit from 0-length training cycle and potentially it is the bug of some kind that is prevented on caller logic level * `progbar` attribute initialisation is definitely related to output verbosity (log values accumulation are not) and should be left under verbosity condition
- Loading branch information
Showing
4 changed files
with
143 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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