Skip to content

Regarding reproducibility of the results. #1067

Answered by AndreaCossu
AdityaJainTD asked this question in Q&A
Discussion options

You must be logged in to vote

In addition, try calling this function at the beginning of your main

def set_seed(seed):
    if seed is None:
        return
    torch.manual_seed(seed)
    torch.cuda.manual_seed(seed)
    np.random.seed(seed)
    random.seed(seed)
    if torch.cuda.is_available():
        torch.backends.cudnn.deterministic = True
        torch.backends.cudnn.enabled = True
        torch.backends.cudnn.benchmark = False

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@AdityaJainTD
Comment options

@AdityaJainTD
Comment options

@AntonioCarta
Comment options

Answer selected by AdityaJainTD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants