From 6b14ec5eeebc0b82b413f18383ba61e0c865548a Mon Sep 17 00:00:00 2001 From: Espen Haugsdal Date: Wed, 30 Sep 2020 14:38:24 +0200 Subject: [PATCH] Do not set PYTHONHASHSEED #2156 (#3745) --- pytorch_lightning/utilities/seed.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pytorch_lightning/utilities/seed.py b/pytorch_lightning/utilities/seed.py index 75aa6290db..1ce782f967 100644 --- a/pytorch_lightning/utilities/seed.py +++ b/pytorch_lightning/utilities/seed.py @@ -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)