카테고리 없음

tensorflow 난수 고정

카카오그래놀라 2021. 7. 1. 15:39
import os
SEED = 42
os.environ['PYTHONHASHSEED'] = str(SEED)
os.environ['TF_DETERMINISTIC_OPS'] = '1'

import random
random.seed(SEED)

import tensorflow as tf
import numpy as np


tf.random.set_seed(SEED)
np.random.seed(SEED)