问题
I have seen this FAQ and this stackoverflow about reproducibility in keras and TF 1.x. How do I do something similar in TF 2.0 because it no longer has tf.Session
? I know I could still set the graph seed and the seed for each initialization in the layer by passing something like tf.keras.initializers.GlorotNormal(seed=10)
. However, I am wondering if there is something more convenient.
回答1:
Consider using tf.random.set_seed(seed)
at the startup. In my use cases it provides reproducible results.
来源:https://stackoverflow.com/questions/60127576/how-do-i-get-reproducible-results-with-tensorflow-2-0