Tutorial: Anaconda + TensorFlow 2.0 @ Ubuntu 18.04

Installation of Anaconda and TensorFlow 2.0 at Ubuntu 18.04

Sik-Ho Tsang
2 min readFeb 13, 2020

In this story, I will install Anaconda and TensorFlow 2.0 at Ubuntu 18.04. It is supposed that, at Ubuntu, you have installed the updated GPU driver, CUDA and cuDNN. If not, please refer to my another story: Tutorial: CUDA v10.2 + CUDNN v7.6.5 Installation @ Ubuntu 18.04. (Sik-Ho Tsang @ Medium)

Outline

  1. Anaconda Installation
  2. TensorFlow Installation
  3. Import TensorFlow

1. Anaconda Installation

bash Anaconda3-2019.10-Linux-x86_64.sh

2. TensorFlow Installation

  • For me, I create a new virtual environment for TensorFlow installation to keep the base clean.
  • As my computer got GPU, I install the GPU version with tf-gpu as the name of the new virtual environment.
conda create -n tf-gpu tensorflow-gpu
  • After that, activate it:
conda activate tf-gpu

3. Import TensorFlow

  • Go into python:
python
  • If TensorFlow is successfully installed, we can import it.
import tensorflow as tf
  • And we can print the version
print(tf.version)
  • It should be version 2.0.

--

--

Sik-Ho Tsang
Sik-Ho Tsang

Written by Sik-Ho Tsang

PhD, Researcher. I share what I learn. :) Linktree: https://linktr.ee/shtsang for Twitter, LinkedIn, etc.

No responses yet