tf.reset_default_graph()
with tf.Graph().as_default():
tf.set_random_seed(42)
with tf.Session() as sess:
...define graph here...
- Must reset default graph before defining graph & must set random seed before creating session.
- Some GPU ops are not fully deterministic
- Some said setting the graph seed is not enough, and op seed is also required, but so far just graph seed works for me
- ref: http://stackoverflow.com/a/40247201/2005810