mirror of
https://github.com/saymrwulf/stable-baselines3.git
synced 2026-11-18 09:54:10 +00:00
Fix memory leak in base_class.py (#1908)
* Fix memory leak in base_class.py Loading the data return value is not necessary since it is unused. Loading the data causes a memory leak through the ep_info_buffer variable. I found this while loading a PPO learner from storage on a multi-GPU system since the ep_info_buffer is loaded to the memory location it was on while it was saved to disk, instead of the target loading location, and is then not cleaned up. * Update changelog.rst * Update changelog --------- Co-authored-by: Antonin RAFFIN <antonin.raffin@ensta.org>
This commit is contained in:
parent
4317c62598
commit
6c00565778
3 changed files with 7 additions and 5 deletions
|
|
@ -3,7 +3,7 @@
|
||||||
Changelog
|
Changelog
|
||||||
==========
|
==========
|
||||||
|
|
||||||
Release 2.4.0a0 (WIP)
|
Release 2.4.0a1 (WIP)
|
||||||
--------------------------
|
--------------------------
|
||||||
|
|
||||||
Breaking Changes:
|
Breaking Changes:
|
||||||
|
|
@ -14,6 +14,8 @@ New Features:
|
||||||
|
|
||||||
Bug Fixes:
|
Bug Fixes:
|
||||||
^^^^^^^^^^
|
^^^^^^^^^^
|
||||||
|
- Fixed memory leak when loading learner from storage, ``set_parameters()`` does not try to load the object data anymore
|
||||||
|
and only loads the PyTorch parameters (@peteole)
|
||||||
- Cast type in compute gae method to avoid error when using torch compile (@amjames)
|
- Cast type in compute gae method to avoid error when using torch compile (@amjames)
|
||||||
|
|
||||||
`SB3-Contrib`_
|
`SB3-Contrib`_
|
||||||
|
|
@ -30,7 +32,7 @@ Deprecations:
|
||||||
|
|
||||||
Others:
|
Others:
|
||||||
^^^^^^^
|
^^^^^^^
|
||||||
- Fix various typos (@cschindlbeck)
|
- Fixed various typos (@cschindlbeck)
|
||||||
|
|
||||||
Bug Fixes:
|
Bug Fixes:
|
||||||
^^^^^^^^^^
|
^^^^^^^^^^
|
||||||
|
|
@ -1659,4 +1661,4 @@ And all the contributors:
|
||||||
@anand-bala @hughperkins @sidney-tio @AlexPasqua @dominicgkerr @Akhilez @Rocamonde @tobirohrer @ZikangXiong @ReHoss
|
@anand-bala @hughperkins @sidney-tio @AlexPasqua @dominicgkerr @Akhilez @Rocamonde @tobirohrer @ZikangXiong @ReHoss
|
||||||
@DavyMorgan @luizapozzobon @Bonifatius94 @theSquaredError @harveybellini @DavyMorgan @FieteO @jonasreiher @npit @WeberSamuel @troiganto
|
@DavyMorgan @luizapozzobon @Bonifatius94 @theSquaredError @harveybellini @DavyMorgan @FieteO @jonasreiher @npit @WeberSamuel @troiganto
|
||||||
@lutogniew @lbergmann1 @lukashass @BertrandDecoster @pseudo-rnd-thoughts @stefanbschneider @kyle-he @PatrickHelm @corentinlger
|
@lutogniew @lbergmann1 @lukashass @BertrandDecoster @pseudo-rnd-thoughts @stefanbschneider @kyle-he @PatrickHelm @corentinlger
|
||||||
@marekm4 @stagoverflow @rushitnshah @markscsmith @NickLucche @cschindlbeck
|
@marekm4 @stagoverflow @rushitnshah @markscsmith @NickLucche @cschindlbeck @peteole
|
||||||
|
|
|
||||||
|
|
@ -592,7 +592,7 @@ class BaseAlgorithm(ABC):
|
||||||
if isinstance(load_path_or_dict, dict):
|
if isinstance(load_path_or_dict, dict):
|
||||||
params = load_path_or_dict
|
params = load_path_or_dict
|
||||||
else:
|
else:
|
||||||
_, params, _ = load_from_zip_file(load_path_or_dict, device=device)
|
_, params, _ = load_from_zip_file(load_path_or_dict, device=device, load_data=False)
|
||||||
|
|
||||||
# Keep track which objects were updated.
|
# Keep track which objects were updated.
|
||||||
# `_get_torch_save_params` returns [params, other_pytorch_variables].
|
# `_get_torch_save_params` returns [params, other_pytorch_variables].
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
2.4.0a0
|
2.4.0a1
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue