boostcampaitech5 / level2_klue-nlp-04

level2_klue-nlp-04 created by GitHub Classroom
1 stars 0 forks source link

[Etc] Model 재현을 위해, Seed 고정 필요 #3

Closed dbsrlskfdk closed 1 year ago

dbsrlskfdk commented 1 year ago

현재

Try

기대사항

dbsrlskfdk commented 1 year ago

train.py

def seed_everything(seed: int = 42):
  random.seed(seed)
  np.random.seed(seed)
  os.environ["PYTHONHASHSEED"] = str(seed)
  torch.manual_seed(seed)
  torch.cuda.manual_seed(seed)
  torch.backends.cudnn.deterministic = True
  torch.backends.cudnn.benchmark = True

~~~

def train():
  seed_everything(42)
  ~~~