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

设置随机数种子却不能复现结果 #7

Open
Hhhhhhhzf opened this issue Jul 7, 2021 · 0 comments
Open

设置随机数种子却不能复现结果 #7

Hhhhhhhzf opened this issue Jul 7, 2021 · 0 comments

Comments

@Hhhhhhhzf
Copy link

如题。以下代码运行两次发现结果不能复现。
除此之外,还固定了numpy和pytorch的随机数种子,还是无法复现。
请问,应该如何设置种子?

from utils import setup_seed
from textda.data_expansion import data_expansion
import random

if __name__ == '__main__':
    # setup_seed(1)
    random.seed(1)
    print(data_expansion('这是一句测试的句子。'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant