When tensorflow-gpu uses GPU, its efficiency is the same as that of CPU.

The

setting uses GPU, but there is no change in computing speed, and gpu utilization is extremely low.
here is part of the code:

< hr >
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")


  1. Task Manager displays 3D and Copy items by default, but when using cuda, you mainly use Compute and Copy,. You need to switch
  2. .
  3. Copy is only about 2%, the amount of data is small, and the model is too simple to give full play to the advantages of GPU

that depends on what data you are running on. If you have small data, you don't need much computation in the first place. On the contrary, the transfer of data back and forth between CPU and GPU will slow down the calculation. There is no need to use GPU, to give full play to computing advantages with a small amount of data.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b2c20f-2bae1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b2c20f-2bae1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?