TensorFlow conveniently offers several types of installation and operates on multiple operating systems. The basic installation is CPU-only, while more advanced installations unleash serious horsepower by pushing calculations onto the graphics card, or even to multiple graphics cards. We recommend starting with a basic CPU installation at first. More complex GPU and CUDA installations will be discussed in Appendix, Advanced Installation.
Even with just a basic CPU installation, TensorFlow offers multiple options, which are as follows:
- A basic Python pip installation
- A segregated Python installation via Virtualenv
- A fully segregated container-based installation via Docker
We recommend a Python installation via Virtualenv, but our examples will use a basic Python pip installation to help you focus on the crux of our task, that is, getting TensorFlow up and running. Again, more advanced installation types will be covered in Appendix, Advanced Installation.
TensorFlow can fully work on Linux and macOS with both Python 2.7 and 3.5. On Windows, we can only use TensorFlow with Python 3.5.x or 3.6.x. It can also be easily used on Windows by running a Linux virtual machine (VM). With an Ubuntu virtual machine, we can use TensorFlow with Python 2.7. However, we can't use TensorFlow with GPU support in a virtual machine. As of TensorFlow 1.2, TensorFlow doesn't provide GPU support on macOS. Therefore, if you want to use macOS with GPU-enabled TensorFlow, you will have to compile from sources, which is out of the scope of this chapter. Otherwise, you can still use TensorFlow 1.0 or 1.1, which provides GPU support out of the box on macOS. Linux and Windows users can use TensorFlow with both CPU and GPU support.