I have installed the GPU version of tensorflow on an Ubuntu 14.04.
I am on a GPU server where tensorflow can access the available GPUs.
I want to run tensorflow on the CPUs.
Normally I can use env CUDA_VISIBLE_DEVICES=0
to run on GPU no. 0.
How can I pick between the CPUs instead?
I am not intersted in rewritting my code with with tf.device("/cpu:0"):
If the above answers don't work, try:
You can also set the environment variable to
without having to modify the source code.
For me, only setting
CUDA_VISIBLE_DEVICES
to precisely-1
works:Works:
Does not work:
Just using the code below.
In some systems one have to specify:
BEFORE importing tensorflow.
You can apply
device_count
parameter pertf.Session
:See also protobuf config file:
tensorflow/core/framework/config.proto