In this chapter, you will learn to install TensorFlow 2.0 on your local machine. TensorFlow 2.0 is tested and supported for Python 3.5–3.8 on the following 64-bit systems:
TensorFlow official documentation recommends the following two methods for installation:
TensorFlow 2.0 can be installed using the pip python package manager by running the following commands on your system.
$ pip install --upgrade pip # Upgrade pip
$ pip install tensorflow # Install lastest stable release
$ pip install tensorflow-gpu # Install GPU version of TensorFlow if you have a CUDA enabled GPU
TensorFlow can be used by running the TensorFlow Docker Images.
$ docker pull tensorflow/tensorflow:latest-py3 # Download latest stable image
$ docker run -it -p 8888:8888 tensorflow/tensorflow:latest-py3-jupyter # Start Jupyter server
After installation, TensorFlow can be imported into our code simply as shown below:
import tensorflow as tf # Check tensorflow version print(f'Tensorflow Version: tf.__version__}')
Tensorflow Version: 2.2.0
If you got any errors during installation, feel free to mention it in the comment section below. After successfully installing TensorFlow 2.0 on your local machine, head on to the next chapter on the basic data structures used in TensorFlow 2.0.
Do you want to learn Python, Data Science, and Machine Learning while getting certified? Here are some best selling Datacamp courses that we recommend you enroll in: