Y Y
或Y N
是什么意思?
如何自行设置Y
和N
?
顺便说一下,机器在打印时(在错误机器上)停机
Y Y
Y Y
当打印(在另一台机器上)时,它在两个GPU上成功运行
Y N
N Y
所以我想知道这是不是问题。
编辑:
我使用下面的程序可以让它关机。
import numpy as np
import tensorflow as tf
with tf.device('/gpu:0'):
W = tf.Variable([.3], tf.float32)
b = tf.Variable([-.3], tf.float32)
with tf.device('/gpu:1'):
x = tf.placeholder(tf.float32)
linear_model = W * x + b
y = tf.placeholder(tf.float32)
loss = tf.reduce_sum(tf.square(linear_model - y)) # sum of the squares
optimizer = tf.train.GradientDescentOptimizer(0.01)
train = optimizer.minimize(loss)
x_train = [1,2,3,4]
y_train = [0,-1,-2,-3]
init = tf.global_variables_initializer()
sess = tf.Session()
sess.run(init)
for i in range(1000):
sess.run(train, {x:x_train, y:y_train})
# evaluate training accuracy
curr_W, curr_b, curr_loss = sess.run([W, b, loss], {x:x_train, y:y_train})
print("W: %s b: %s loss: %s"%(curr_W, curr_b, curr_loss))
答案 0 :(得分:0)