Skip to content
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

fix seed #2744

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open

fix seed #2744

wants to merge 4 commits into from

Conversation

zhangyubo0722
Copy link
Collaborator

fix seed

@paddle-bot
Copy link

paddle-bot bot commented Apr 7, 2023

Thanks for your contribution!

@TingquanGao
Copy link
Collaborator

fix #2743

@TingquanGao TingquanGao changed the title modify engine fix seed Apr 7, 2023
@@ -63,7 +63,7 @@ def __init__(self, config, mode="train"):

# set seed
seed = self.config["Global"].get("seed", False)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的get直接返回None会不会好点。

seed = self.config["Global"].get("seed", None)
if seed is not None:
    ...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"The random seed cannot be None in a distributed environment. Global.seed has been set to 42 by default"

不太理解这句话。分布式对随机种子有要求的地方,是不是只有distributed sampler。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants