Ich versuche Distributed TensorFlow zu lernen. Versucht ein Stück Code, wie here erklärt:Kann TensorFlow mit mehreren CPUs (keine GPUs) laufen?
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]))
die folgende Fehlermeldung bekommen:
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)]]
Was bedeutet, dass TensorFlow nicht CPU erkennt: 1.
Ich bin auf einem RedHat-Server mit 40 CPUs (cat /proc/cpuinfo | grep processor | wc -l
) ausgeführt.
Irgendwelche Ideen?
Haben Sie 40 CPU oder 40 Kerne? – raam86
raam86 nach https://askubuntu.com/questions/724228/how-to-find-the-number-of-cpu-cores-including-virtual 40 cpus –
Ich habe einmal verwendet mehrere CPU-Verarbeitung mit sci-kit lernen (GridSearchCV-Funktion) über Tensorflow-Backbone .. Also ich denke, es ist möglich. Aber ich bin mir nicht sicher, wie man es in Tensorflow-Ebene implementiert – Eduardo