Installing TensorFlow 2.0

Table of Contents
Primary Item (H2)

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:

  • Ubuntu 16.04 or later
  • Windows 7 or later
  • macOS 10.12.6 (Sierra) or later (no GPU support)
  • Raspbian 9.0 or later

TensorFlow official documentation recommends the following two methods for installation:

1. Install using pip in Python

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

2. Run a TensorFlow Docker Container

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.


Installing TensorFlow 2.0Installing 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:

  1. Introduction to Python (Free Course) - 1,000,000+ students already enrolled!
  2. Introduction to Data Science  in Python- 400,000+ students already enrolled!
  3. Introduction to TensorFlow for Deep Learning with Python - 90,000+ students already enrolled!
  4. Data Science and Machine Learning Bootcamp with R - 70,000+ students already enrolled!
Written by
The Click Reader
At The Click Reader, we are committed to empowering individuals with the tools and knowledge needed to excel in the ever-evolving field of data science. Our sole focus is delivering a world-class data science bootcamp that transforms beginners and upskillers into industry-ready professionals.

Interested In Data Science Bootcamp?
Request more info now.

Lead Collection Form
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram