How to create a CNN with deterministic operations in TensorFlow on a GPU?

强颜欢笑 提交于 2019-12-24 08:46:24

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!