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

fix: keras.TqdmCallback: batch_bar does not always exist on_train_end #1508

Merged
merged 1 commit into from Feb 5, 2024

Conversation

firatozdemir
Copy link
Contributor

when verbose==2, TqdmCallback object does not define batch_bar inside __init__ but only in on_epoch_begin.
If keras.model.fit is run after all training epochs are finished, on_train_end throws error because self.batch_bar does not exist.

Fix is to check if batch_bar attribute exists before closing it, similar to how it is handled inside on_epoch_begin.

@casperdcl casperdcl added p0-bug-critical ☢ Exception rasing submodule ⊂ Periphery/subclasses to-merge ↰ Imminent c1-quick 🕐 Complexity low labels Feb 5, 2024
@casperdcl casperdcl merged commit 9590fa1 into tqdm:master Feb 5, 2024
1 check passed
@casperdcl
Copy link
Sponsor Member

Thanks! Sorry for the delay...

@casperdcl casperdcl added this to Done in Casper Feb 5, 2024
@casperdcl casperdcl mentioned this pull request Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c1-quick 🕐 Complexity low p0-bug-critical ☢ Exception rasing submodule ⊂ Periphery/subclasses to-merge ↰ Imminent
Projects
Casper
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants