mirror of
https://github.com/saymrwulf/stable-baselines3.git
synced 2026-07-29 20:14:17 +00:00
Fix random seed int32 for Windows (#1655)
* reduce high in randint to avoid Windows oob error * update changelog * implements @MikhailGerasimov's suggestion --------- Co-authored-by: Antonin RAFFIN <antonin.raffin@ensta.org>
This commit is contained in:
parent
e9f0f23ce4
commit
5c93e9f426
2 changed files with 3 additions and 3 deletions
|
|
@ -3,7 +3,6 @@
|
|||
Changelog
|
||||
==========
|
||||
|
||||
|
||||
Release 2.2.0a0 (WIP)
|
||||
--------------------------
|
||||
|
||||
|
|
@ -21,6 +20,7 @@ New Features:
|
|||
|
||||
Bug Fixes:
|
||||
^^^^^^^^^^
|
||||
- Prevents OOB error on Windows if no seed is passed (@PatrickHelm)
|
||||
|
||||
Deprecations:
|
||||
^^^^^^^^^^^^^
|
||||
|
|
@ -1444,4 +1444,4 @@ And all the contributors:
|
|||
@Melanol @qgallouedec @francescoluciano @jlp-ue @burakdmb @timothe-chaumont @honglu2875
|
||||
@anand-bala @hughperkins @sidney-tio @AlexPasqua @dominicgkerr @Akhilez @Rocamonde @tobirohrer @ZikangXiong
|
||||
@DavyMorgan @luizapozzobon @Bonifatius94 @theSquaredError @harveybellini @DavyMorgan @FieteO @jonasreiher @npit @WeberSamuel @troiganto
|
||||
@lutogniew @lbergmann1 @lukashass @BertrandDecoster @pseudo-rnd-thoughts @stefanbschneider @kyle-he
|
||||
@lutogniew @lbergmann1 @lukashass @BertrandDecoster @pseudo-rnd-thoughts @stefanbschneider @kyle-he @PatrickHelm
|
||||
|
|
|
|||
|
|
@ -278,7 +278,7 @@ class VecEnv(ABC):
|
|||
if seed is None:
|
||||
# To ensure that subprocesses have different seeds,
|
||||
# we still populate the seed variable when no argument is passed
|
||||
seed = np.random.randint(0, 2**32 - 1)
|
||||
seed = int(np.random.randint(0, np.iinfo(np.uint32).max, dtype=np.uint32))
|
||||
|
||||
self._seeds = [seed + idx for idx in range(self.num_envs)]
|
||||
return self._seeds
|
||||
|
|
|
|||
Loading…
Reference in a new issue