Reader small image

You're reading from  Computer Vision Projects with OpenCV and Python 3

Product typeBook
Published inDec 2018
Reading LevelIntermediate
PublisherPackt
ISBN-139781789954555
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Matthew Rever
Matthew Rever
author image
Matthew Rever

Matthew Rever received his PhD. in electrical engineering from the University of Michigan, Ann Arbor. His career revolves around image processing, computer vision, and machine learning for scientific research applications. He started programming in C++, a language he still uses today, over 20 years ago, and has also used Matlab and most heavily Python in the past few years, using OpenCV, SciPy, scikit-learn, TensorFlow, and PyTorch. He believes it is important to stay up to date on the latest tools to be as productive as possible. Dr. Rever is the author of Packt's Computer Vision Projects with Python 3 and Advanced Computer Vision Projects.
Read more about Matthew Rever

Right arrow

Speeding up computation with your GPU

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. This is needed in order to run TensorFlow with the GPU. If everything is set up properly, you will see a message very similar to the preceding output for your GPU, your card model, and details about it such as its...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Computer Vision Projects with OpenCV and Python 3
Published in: Dec 2018Publisher: PacktISBN-13: 9781789954555

Author (1)

author image
Matthew Rever

Matthew Rever received his PhD. in electrical engineering from the University of Michigan, Ann Arbor. His career revolves around image processing, computer vision, and machine learning for scientific research applications. He started programming in C++, a language he still uses today, over 20 years ago, and has also used Matlab and most heavily Python in the past few years, using OpenCV, SciPy, scikit-learn, TensorFlow, and PyTorch. He believes it is important to stay up to date on the latest tools to be as productive as possible. Dr. Rever is the author of Packt's Computer Vision Projects with Python 3 and Advanced Computer Vision Projects.
Read more about Matthew Rever