Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/kotlin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Tensorflow tf.random.shuffle即使指定了种子,也不会给出可重复的结果_Tensorflow - Fatal编程技术网

Tensorflow tf.random.shuffle即使指定了种子,也不会给出可重复的结果

Tensorflow tf.random.shuffle即使指定了种子,也不会给出可重复的结果,tensorflow,Tensorflow,函数seed=something中有一个参数。即使我设置了它的值,洗牌也会给出随机结果。我想要同样的结果 tf.random.suffle(tf.range(5), seed=5) 如果你想复制洗牌结果,请在TF2.0测试版上使用以下命令 tf.random.set_seed5 tf.random.shuffletf.range5 tf.random.set_seed5 tf.random.shuffletf.range5 tf.random.set_seed5 tf.random.shuff

函数seed=something中有一个参数。即使我设置了它的值,洗牌也会给出随机结果。我想要同样的结果

tf.random.suffle(tf.range(5), seed=5)

如果你想复制洗牌结果,请在TF2.0测试版上使用以下命令

tf.random.set_seed5 tf.random.shuffletf.range5 tf.random.set_seed5 tf.random.shuffletf.range5 tf.random.set_seed5 tf.random.shuffletf.range5 关于您使用的种子,它确实无法复制TF2.0测试版中测试的结果

在tf1.x中,我相信正确的函数是TF.random.set\u random\u seed


从中,我可以看到有op级种子和图形级种子。您正在设置操作级别,但这还不够-使用上述代码中的函数设置图形级别种子可以解决此问题。

如果种子参数不起作用,那么它到底有什么意义?从它看来,似乎有两个种子。