Using Multiple Cpu Cores In Tensorflow
I have extensively studied other answers on TensorFlow and I just cannot seem to get it to use multiple cores on my CPU. According to htop, the following program only uses a single
Solution 1:
After some back and forth on the TensorFlow issue here we determined that the issue was that the program was being "optimized" by a constant folding pass, because the inputs were all trivial. It turns out this constant folding pass runs sequentially. Therefore, if you want to observe a parallel execution, the way to do this is to make the inputs non-trivial so that the constant folding won't apply to them. The method suggested in the issue was to use tf.placeholder
, and I have written an example program that makes use of this here:
https://gist.github.com/elliottslaughter/750a27c832782f4daec8686281027de8
See the original issue for sample output from the program: https://github.com/tensorflow/tensorflow/issues/22619
Post a Comment for "Using Multiple Cpu Cores In Tensorflow"