From a2c605785a85ab2e599b3390f98f71a47db78811 Mon Sep 17 00:00:00 2001 From: Roger Shieh Date: Wed, 7 Apr 2021 19:17:48 +0800 Subject: [PATCH] Update seed_everything() (#6843) * Update seed.py * Update pytorch_lightning/utilities/seed.py Co-authored-by: thomas chaton * Update seed.py * Update seed.py * Update seed.py Co-authored-by: thomas chaton --- pytorch_lightning/utilities/seed.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pytorch_lightning/utilities/seed.py b/pytorch_lightning/utilities/seed.py index 8129075f99..c3da02b7d2 100644 --- a/pytorch_lightning/utilities/seed.py +++ b/pytorch_lightning/utilities/seed.py @@ -53,6 +53,8 @@ def seed_everything(seed: Optional[int] = None) -> int: rank_zero_warn(f"{seed} is not in bounds, numpy accepts from {min_seed_value} to {max_seed_value}") seed = _select_seed_randomly(min_seed_value, max_seed_value) + # using `log.info` instead of `rank_zero_info`, + # so users can verify the seed is properly set in distributed training. log.info(f"Global seed set to {seed}") os.environ["PL_GLOBAL_SEED"] = str(seed) random.seed(seed)