Last active
October 24, 2018 09:23
-
-
Save mirrornerror/8e03fc372e5481baf7f7aa2a9c1cc227 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import tensorflow as tf | |
import random as rn | |
import os | |
os.environ['PYTHONHASHSEED'] = '0' | |
random_n = 123 | |
np.random.seed(random_n) | |
rn.seed(random_n) | |
session_conf = tf.ConfigProto(intra_op_parallelism_threads=1, inter_op_parallelism_threads=1) | |
from keras import backend as K | |
tf.set_random_seed(random_n) | |
sess = tf.Session(graph=tf.get_default_graph(), config=session_conf) | |
K.set_session(sess) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment