setting uses GPU, but there is no change in computing speed, and gpu utilization is extremely low.
here is part of the code:
from tensorflow.python.framework import ops
ops.reset_default_graph()
config = tf.ConfigProto()
config.gpu_options.per_process_gpu_memory_fraction = 0.85
config.gpu_options.allow_growth = True
sess = tf.Session(config=config)
with tf.device("/GPU:0"):
x = tf.placeholder(shape=[None, 20],dtype=tf.float32, name="x_m")
y = tf.placeholder(shape=[None, 2], dtype=tf.float32, name="y_m")
with tf.name_scope("cross_entropy"):
y_ = train_model_gpu(x)
cross_entropy = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(logits=y_, labels=y), name="cross_entropy_m")