-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
seed_everything() runs _select_seed_randomly() even if PL_GLOBAL_SEED is set #4741
Comments
Hi! thanks for your contribution!, great first issue! |
Thanks for the issue! Could you verify #4743 fixes this? |
It seems that this fixes my problem. But it introduces another one as any seed is now incorrect because of: |
This issue has been automatically marked as stale because it hasn't had any recent activity. This issue will be closed in 7 days if no further activity occurs. Thank you for your contributions, Pytorch Lightning Team! |
Still waiting for a fix. |
🐛 Bug
There is a bug in
pl.utilities.seed.seed_everything()
.The problem is here:
https://github.com/PyTorchLightning/pytorch-lightning/blob/1.0.5/pytorch_lightning/utilities/seed.py#L44
If
None
is passed as a seed:seed = os.environ.get("PL_GLOBAL_SEED", _select_seed_randomly(min_seed_value, max_seed_value))
is run. And
_select_seed_randomly
is run even ifPL_GLOBAL_SEED
is present inos.environ
.The seed is set properly, but there is a warning displayed that suggests a different seed had been set. This introduces some confusion, especially during training with ddp.
To Reproduce
Expected behavior
The code above produces the following output:
_select_seed_randomly(min_seed_value, max_seed_value)
should only be run when there is noPL_GLOBAL_SEED
set.Environment
The text was updated successfully, but these errors were encountered: