Having installed tensorflow GPU (running on a measly NVIDIA GeForce 950), I would like to compare performance with the CPU.
I am running the tensorFlow MNIST tutorial code, and have noticed a dramatic increase in speed--estimated anyways (I ran the CPU version 2 days ago on a laptop i7 with a batch size of 100, and this on a desktop GPU, batch size of 10)--between the CPU and the GPU when I switched...but I only noticed the speed increase when I lowered the batch size on the GPU to 10 from 100...
Now I lack an objective measure for what I am gaining.
Is there a way to toggle between the CPU and GPU tensor flows?
TensorFlow supports running computations on a variety of types of devices, including CPU and GPU. They are represented with string identifiers for example: "/device:CPU:0" : The CPU of your machine.
When both tensorflow and tensorflow-gpu are installed , is it by default CPU or GPU accelaration? In case both are installed, tensorflow will place operations on GPU by default unless instructed not to.
If a TensorFlow operation has both CPU and GPU implementations, TensorFlow will automatically place the operation to run on a GPU device first. If you have more than one GPU, the GPU with the lowest ID will be selected by default. However, TensorFlow does not place operations into multiple GPUs automatically.
To make GPU invisible
export CUDA_VISIBLE_DEVICES=""
To return to normal
unset CUDA_VISIBLE_DEVICES
try setting tf.device to cpu:0
with tf.Session() as sess: with tf.device("/cpu:0"):
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With