December 2018
Intermediate to advanced
182 pages
4h 21m
English
In this section, we'll talk briefly about speeding up computations with your GPU. The good news is that TensorFlow is actually very smart about using the GPU, so if you have everything set up, then it's pretty simple.
Let's see what things look like if we have the GPU properly set up. First, import TensorFlow as follows:
import tensorflow
Next, we print tensorflow.Session(). This just gives us information about our CPU and GPU (if it is properly set up):
print(tensorflow.Session())
The output is as follows:

As we can see from the output, we're using a laptop with a GeForce GTX 970M, which is CUDA-compatible. ...
Read now
Unlock full access