I am trying to learn distributed TensorFlow. Tried a piece of code as described here :
with tf.device("/cpu:0"):
W = tf.Variable(tf.zeros([784, 10]))
b = tf.Variable(tf.zeros([10]))
with tf.device("/cpu:1"):
y = tf.nn.softmax(tf.matmul(x, W) + b)
loss = tf.reduce_mean(-tf.reduce_sum(y_ * tf.log(y), reduction_indices=[1]))
Getting the following error:
tensorflow.python.framework.errors_impl.InvalidArgumentError: Cannot assign a device for operation 'MatMul': Operation was explicitly assigned to / device: CPU: 1 but available devices are [/ job: localhost / replica: 0 / task: 0 / cpu : 0]. Make sure the device specification refers to a valid device.
[[Node: MatMul = MatMul [T = DT_FLOAT, transpose_a = false, transpose_b = false, _device = "/ device: CPU: 1"] (Placeholder, Variable / read)]]This means that TensorFlow does not recognize the processor: 1 .
I work on a RedHat server with 40 processors ( cat/proc/cpuinfo | grep processor | wc -l).
Any ideas?
source
share