Fix ProgressBarCallback under-reporting (#1260)

* Updated tqdm progress bar constructor to account for the effects of train_freq/n_steps/num_envs on total_timesteps. Ensure progress bar is "flushed" on training end.

* Added description of PR #1260. Fixed formatting typo

* Partial revert

Co-authored-by: dominicgkerr <dominicgkerr1@gmail.co>
Co-authored-by: Antonin RAFFIN <antonin.raffin@ensta.org>
Co-authored-by: Antonin Raffin <antonin.raffin@dlr.de>
This commit is contained in:
Dominic Kerr 2023-01-10 14:17:52 +00:00 committed by GitHub
parent 30a19848ce
commit 5aa6e7d340
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -53,6 +53,7 @@ New Features:
Bug Fixes:
^^^^^^^^^^
- Updated ``ProgressBarCallback`` to more accurately display the proportion of remaining timesteps (@dominicgkerr)
- Fixed return type of ``evaluate_actions`` in ``ActorCritcPolicy`` to reflect that entropy is an optional tensor (@Rocamonde)
- Fixed type annotation of ``policy`` in ``BaseAlgorithm`` and ``OffPolicyAlgorithm``
- Allowed model trained with Python 3.7 to be loaded with Python 3.8+ without the ``custom_objects`` workaround
@ -180,7 +181,7 @@ Others:
^^^^^^^
- Fixed ``DictReplayBuffer.next_observations`` typing (@qgallouedec)
- Added support for ``device="auto"`` in buffers and made it default (@qgallouedec)
- Updated ``ResultsWriter` (used internally by ``Monitor`` wrapper) to automatically create missing directories when ``filename`` is a path (@dominicgkerr)
- Updated ``ResultsWriter`` (used internally by ``Monitor`` wrapper) to automatically create missing directories when ``filename`` is a path (@dominicgkerr)
Documentation:
^^^^^^^^^^^^^^

View file

@ -685,5 +685,6 @@ class ProgressBarCallback(BaseCallback):
return True
def _on_training_end(self) -> None:
# Close progress bar
# Flush and close progress bar
self.pbar.refresh()
self.pbar.close()