mirror of
https://github.com/saymrwulf/stable-baselines3.git
synced 2026-05-26 22:45:15 +00:00
Fix for saving big replay buffer, use pickle protocol>=4 (#239)
This commit is contained in:
parent
3207bdab17
commit
723b341c61
2 changed files with 5 additions and 2 deletions
|
|
@ -32,6 +32,7 @@ Bug Fixes:
|
|||
- Fixed ``DQN`` predict method when using single ``gym.Env`` with ``deterministic=False``
|
||||
- Fixed bug that the arguments order of ``explained_variance()`` in ``ppo.py`` and ``a2c.py`` is not correct (@thisray)
|
||||
- Fixed bug where full ``HerReplayBuffer`` leads to an index error. (@megan-klaiber)
|
||||
- Fixed bug where replay buffer could not be saved if it was too big (> 4 Gb) for python<3.8 (thanks @hn2)
|
||||
|
||||
Deprecations:
|
||||
^^^^^^^^^^^^^
|
||||
|
|
@ -523,4 +524,4 @@ And all the contributors:
|
|||
@flodorner @KuKuXia @NeoExtended @PartiallyTyped @mmcenta @richardwu @kinalmehta @rolandgvc @tkelestemur @mloo3
|
||||
@tirafesi @blurLake @koulakis @joeljosephjin @shwang @rk37 @andyshih12 @RaphaelWag @xicocaio
|
||||
@diditforlulz273 @liorcohen5 @ManifoldFR @mloo3 @SwamyDev @wmmc88 @megan-klaiber @thisray
|
||||
@tfederico
|
||||
@tfederico @hn2
|
||||
|
|
|
|||
|
|
@ -337,7 +337,9 @@ def save_to_pkl(path: Union[str, pathlib.Path, io.BufferedIOBase], obj: Any, ver
|
|||
:param verbose: Verbosity level, 0 means only warnings, 2 means debug information.
|
||||
"""
|
||||
with open_path(path, "w", verbose=verbose, suffix="pkl") as file_handler:
|
||||
pickle.dump(obj, file_handler)
|
||||
# Use protocol>=4 to support saving replay buffers >= 4Gb
|
||||
# See https://docs.python.org/3/library/pickle.html
|
||||
pickle.dump(obj, file_handler, protocol=pickle.HIGHEST_PROTOCOL)
|
||||
|
||||
|
||||
def load_from_pkl(path: Union[str, pathlib.Path, io.BufferedIOBase], verbose: int = 0) -> Any:
|
||||
|
|
|
|||
Loading…
Reference in a new issue