问题
So after I realize there are operations in TensorFlow which are non-deterministic, see this Question: How to get the same loss value, every time training a CNN (MNIST data set), with TensorFlow?, I want to know:
How can I build a convolutional neural net with:
- TensorFlow Version 1.1.0
- CUDA release 8.0, V8.0.61
- cuDNN 5.1.10
- run on GPU
which use only deterministic operations?
回答1:
You can't until every operation on cuDNN is not completely deterministic. Moreover, even moving every operation on the GPU, if it uses (and it probably does) SSE instructions you could obtain different results executing the same identical (and without randomness) code more than once.
The best thing you can do to get close to your goal, it to set the seed
for every operation that contains randomness (the op-level seed) and set the seed for the whole graph (tf.set_random_seed(value)
).
来源:https://stackoverflow.com/questions/44800055/how-to-create-a-cnn-with-deterministic-operations-in-tensorflow-on-a-gpu