Issue
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"):
Solution
You can apply device_count
parameter per tf.Session
:
config = tf.ConfigProto(
device_count = {'GPU': 0}
)
sess = tf.Session(config=config)
See also protobuf config file:
tensorflow/core/framework/config.proto
Answered By - Ivan Aksamentov - Drop
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.