Skip to content

Commit 5aa6e7d

Browse files
dominicgkerrdominicgkerraraffin
authored
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 <[email protected]> Co-authored-by: Antonin RAFFIN <[email protected]> Co-authored-by: Antonin Raffin <[email protected]>
1 parent 30a1984 commit 5aa6e7d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

docs/misc/changelog.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ New Features:
5353

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

185186
Documentation:
186187
^^^^^^^^^^^^^^

stable_baselines3/common/callbacks.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,5 +685,6 @@ def _on_step(self) -> bool:
685685
return True
686686

687687
def _on_training_end(self) -> None:
688-
# Close progress bar
688+
# Flush and close progress bar
689+
self.pbar.refresh()
689690
self.pbar.close()

0 commit comments

Comments
 (0)