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

How to fix random seed? #31

Open
LiuHuijie6410 opened this issue Mar 31, 2024 · 1 comment
Open

How to fix random seed? #31

LiuHuijie6410 opened this issue Mar 31, 2024 · 1 comment

Comments

@LiuHuijie6410
Copy link

LiuHuijie6410 commented Mar 31, 2024

Congratulations on a great job.
I've fixed the random seed using the code below, but the output is still different every time.

def init_seed(seed):
    torch.cuda.manual_seed_all(seed)
    torch.manual_seed(seed)
    np.random.seed(seed)
    random.seed(seed)
    # torch.backends.cudnn.enabled = False
    torch.backends.cudnn.deterministic = True
    torch.backends.cudnn.benchmark = False
@ruizhaocv
Copy link
Collaborator

How about trying our original code to fix the generation?

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

2 participants