Tensorflow `set_random_seed` not working
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Calling tf.set_random_seed(SEED) has no effect that I can tell... For example, running the code below several times inside an IPython notebook produces different output each time: import tensorflow as tf tf.set_random_seed(42) sess = tf.InteractiveSession() a = tf.constant([1, 2, 3, 4, 5]) tf.initialize_all_variables().run() a_shuf = tf.random_shuffle(a) print(a.eval()) print(a_shuf.eval()) sess.close() If I set the seed explicitly: a_shuf = tf.random_shuffle(a, seed=42) , the output is the same after each run. But why do I need to set the