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

DeepPrime's output varying depending on the execution environment #94

Open
Goosang-Yu opened this issue May 8, 2024 · 0 comments
Open

Comments

@Goosang-Yu
Copy link
Owner

When running DeepPrime on different servers, there is a problem where the decimal values of the predicted results differ. To address this, we need to add the initialization of a random seed to the init function.

import random
import torch
import numpy as np

# Set seed
seed = 0

# Setting
random.seed(seed)
np.random.seed(seed)
devicd = 'cuda' if torch.cuda.is_available() else 'cpu'
torch.manual_seed(seed)
if device == 'cuda':
    torch.cuda.manual_seed_all(seed)
torch.backends.cudnn.deterministic = True
torch.backends.cudnn.benchmark = False
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