Skip to content

Commit

Permalink
fix random seeds for reproducibility
Browse files Browse the repository at this point in the history
  • Loading branch information
SunQpark committed Sep 10, 2019
1 parent 206c52a commit 130b3e5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions train.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import argparse
import collections
import torch
import numpy as np
import data_loader.data_loaders as module_data
import model.loss as module_loss
import model.metric as module_metric
Expand All @@ -9,6 +10,13 @@
from trainer import Trainer


# fix random seeds for reproducibility
SEED = 123
torch.manual_seed(SEED)
torch.backends.cudnn.deterministic = True
torch.backends.cudnn.benchmark = False
np.random.seed(SEED)

def main(config):
logger = config.get_logger('train')

Expand Down

0 comments on commit 130b3e5

Please sign in to comment.