0

To achieve deterministic results in Keras / Tensorflow, it is (among other things) necessary to "deactivate parallelism", as stated in the Keras doc:

# Force TensorFlow to use single thread.
# Multiple threads are a potential source of
# non-reproducible results.
# For further details, see: https://stackoverflow.com/questions/42022950/which-seeds-have-to-be-set-where-to-realize-100-reproducibility-of-training-res

session_conf = tf.ConfigProto(intra_op_parallelism_threads=1, inter_op_parallelism_threads=1)

This thread also states that (in the comments):

You also need to remove parallelism from your computation because that is often non-deterministic

What makes Tensorflow parallel computations non-deterministic?

Phylliade
  • 1,667
  • 4
  • 19
  • 27
  • This question is given the fact that common parallel computations (BLAS operations for example) are deterministic. – Phylliade Aug 09 '18 at 14:06
  • Actually this happens on CPU tasks (`intra_op_parallelism_threads=1` does not exist for GPUs) – Phylliade Aug 09 '18 at 14:19

0 Answers0