Do not set PYTHONHASHSEED #2156 (#3745)

This commit is contained in:
Espen Haugsdal 2020-09-30 14:38:24 +02:00 committed by GitHub
parent a5f28ced13
commit 6b14ec5eee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -27,7 +27,7 @@ from pytorch_lightning import _logger as log
def seed_everything(seed: Optional[int] = None) -> int:
"""
Function that sets seed for pseudo-random number generators in:
pytorch, numpy, python.random and sets PYTHONHASHSEED environment variable.
pytorch, numpy, python.random
In addition, sets the env variable `PL_GLOBAL_SEED` which will be passed to
spawned subprocesses (e.g. ddp_spawn backend).
@ -53,7 +53,6 @@ def seed_everything(seed: Optional[int] = None) -> int:
)
seed = _select_seed_randomly(min_seed_value, max_seed_value)
os.environ["PYTHONHASHSEED"] = str(seed)
os.environ["PL_GLOBAL_SEED"] = str(seed)
random.seed(seed)
np.random.seed(seed)