1

Tensorflow uses different PRNGs for efficiency but I want reproducible/deterministic results across tensorflow devices. Is there any way I can do that with tensorflow? Also, what PRNG functions does Tensorflow use when it runs on CPU and on GPU?

Edit: Setting random seed tf.set_random_seed(1) will give you deterministic results if you train/infer on the same device but it will not give you the same results if you load the model and continue training on a different device.

captain
  • 815
  • 14
  • 26
  • `tf.set_random_seed` for graph-level random seed. – Severin Pappadeux Jun 25 '18 at 23:32
  • Possible duplicate of [How to get stable results with TensorFlow, setting random seed](https://stackoverflow.com/questions/36288235/how-to-get-stable-results-with-tensorflow-setting-random-seed) – Severin Pappadeux Jun 25 '18 at 23:33
  • @SeverinPappadeux yes, setting random seed will give you deterministic results when used on the same device, but when you train few epochs on one device (e.g. GPU) and continue training on another device (e.g. CPU), you will get different results even if you set that seed. – captain Jun 26 '18 at 00:11
  • ok, retracted my vote – Severin Pappadeux Jun 26 '18 at 00:19

0 Answers0