Hotfix: revert loading with weights_only=True (#1913)

This commit is contained in:
Antonin RAFFIN 2024-04-27 15:08:38 +02:00 committed by GitHub
parent 35eccaf04f
commit 285e01f64a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 20 additions and 2 deletions

View file

@ -33,11 +33,23 @@ Others:
Bug Fixes:
^^^^^^^^^^
Documentation:
^^^^^^^^^^^^^^
Release 2.3.2 (2024-04-27)
--------------------------
Bug Fixes:
^^^^^^^^^^
- Reverted ``torch.load()`` to be called ``weights_only=False`` as it caused loading issue with old version of PyTorch.
Documentation:
^^^^^^^^^^^^^^
- Added ER-MRL to the project page (@corentinlger)
- Updated Tensorboard Logging Videos documentation (@NickLucche)
Release 2.3.1 (2024-04-22)
--------------------------
@ -55,6 +67,11 @@ Release 2.3.0 (2024-03-31)
**New defaults hyperparameters for DDPG, TD3 and DQN**
.. warning::
Because of ``weights_only=True``, this release breaks loading of policies when using PyTorch 1.13.
Please upgrade to PyTorch >= 2.0 or upgrade SB3 version (we reverted the change in SB3 2.3.2)
Breaking Changes:
^^^^^^^^^^^^^^^^^

View file

@ -447,7 +447,8 @@ def load_from_zip_file(
file_content.seek(0)
# Load the parameters with the right ``map_location``.
# Remove ".pth" ending with splitext
th_object = th.load(file_content, map_location=device, weights_only=True)
# Note(antonin): we cannot use weights_only=True, as it breaks with PyTorch 1.13, see GH#1911
th_object = th.load(file_content, map_location=device, weights_only=False)
# "tensors.pth" was renamed "pytorch_variables.pth" in v0.9.0, see PR #138
if file_path == "pytorch_variables.pth" or file_path == "tensors.pth":
# PyTorch variables (not state_dicts)

View file

@ -1 +1 @@
2.4.0a0
2.3.2