DEV Community

Cover image for TensorFlow #1 - Installation and setup
Patryk Gronkiewicz
Patryk Gronkiewicz

Posted on • Edited on

TensorFlow #1 - Installation and setup

Lots of people want to start with neural networks and machine learning and I'm one of them. I've decided to share my progress in some kind of series, because teaching someone is even better method of learning for me.

Where to start?

Disclaimer: Math is very useful, so start with it. I won't explain basics, so you probably want to start with KhanAcademy or something similar. The most useful are:

  1. Calculus
  2. Discrete mathematics (especially graphs & combinatorics).

I'm learning from FreeCodeCamp Tutorial by Tim Ruscica (Tech with Tim).

Installation

I'm using miniconda3 on Linux - it's the easiest way to use TensorFlow in my opinion. We can create virtual environments here.

Miniconda3 installation

Download proper installation file from here. Next run

bash <<miniconda_installation_file>>
Enter fullscreen mode Exit fullscreen mode

Congratulations! Your conda is installed. Restart your terminal and you could see something like (base) at the beginning of your prompt. You may notice that packages installed with pip are not available anymore. You can disable entering base environment with:

conda config --set auto_activate_base false
Enter fullscreen mode Exit fullscreen mode

Restart your terminal once again and everything should be just like before installing conda (but it's still installed of course).

You can now create new environment with

conda create --name env_name
Enter fullscreen mode Exit fullscreen mode

and activate it with

conda activate env_name
Enter fullscreen mode Exit fullscreen mode

TensorFlow installation

Conda is now installed and set up, so it's time to start with TF. It's as easy as

conda install tensorflow-gpu -c conda-forge
Enter fullscreen mode Exit fullscreen mode

if you have nVidia GPU. Just drop the -gpu suffix if you don't want to use it.
Some useful packages are:

  1. numpy - blazing fast arrays
  2. pandas - dataframes
  3. matplotlib - my tool of choice for (guess what :v) plots
  4. jupyterlab - better version of jupyter, but I'm using PyCharm, so it doesn't matter to me.

That's all for now. I'll post some new content soon(tm).

PS. You can also subscribe to my newsletter

Top comments (0)