loss = tf.cond(loss < 0.4,tf.stop_gradient(loss), loss)修改为:loss = tf.cond(loss < 0.4,lambda :tf.stop_gradient(loss), lambda : loss)
loss = tf.cond(loss < 0.4,tf.stop_gradient(loss), loss)
loss = tf.cond(loss < 0.4,lambda :tf.stop_gradient(loss), lambda : loss)