MITB Banner

How To Set Up The AI Development Environment For The First Time With Tensorflow

Share

Building algorithmic agents with neural networks is the go-to business strategy in the current technology environment. Now, Google’s Tensorflow library helps developers build these agents with pre-defined functions for easy implementations of various tasks. In this article, we shall be going through the steps to setup an environment for development of these models with Tensorflow library. Setting up an environment for these tasks is mandatory because each model you build is unique to one another and have different dependencies.

Install Python

As part of the first step, one should download Python. Tensorflow is available on both Python 2 and Python 3. You can download it from here. Once you have downloaded the desired version, you have to set up the environment variables.

You can access the environment variables by either typing it Start menu (Win 8 and Win 10). Or you can go here:

My Computer > Properties > Advanced System Settings > Environment Variables>

You have to add the path of your python. If it is a default Windows installation, the default path will be C:/Python36 for Python 3. If everything has been setup correctly, you can test it by typing python in the command prompt. The output should be as follows:

Setup Virtual Environment

PIP is a installer package for Python which stands for Python Installer Package. If one faces problems with Pip, it is accessible here.

Download get-pip.py, be careful to save it as a .py file rather than .txt. One you are in the directory where the file is downloaded, on command prompt run,

python get-pip.py

Once pip is set, we shall setup the virtual environment with virenv available for Python.

pip install virtualenv


Now make a directory for your virtual environment, let us call it tensorflow_test. And make an environment called “development” and access it.

You have to navigate to the Scripts folder and run the activate command to activate the environment. Here’s how it is done:

Install Tensorflow (CPU/GPU)

Once you have setup all these, you can now install the Tensorflow library. It is as simple as installing the virtualenv. Depending on which version you desire, Tensorflow has a GPU extension which can be accessed by having CUDA and cuDNN installed.

CPU Version:

Once you have the environment set for the installation of Tensorflow, you can run the following command to install the CPU version of Tensorflow. If everything is setup right, the packager will download and install all the dependencies required for Tensorflow and eventually the CPU version.

GPU Version:

If you need the GPU extension of Tensorflow for better computational speed and performance of your system, then you need to install the CUDA and cuDNN from the Nvidia.

Note: Tensorflow currently supports Nvidia GPU cards only.

CUDA toolkit can be downloaded here, and it is similar to setting up the path in the environment during the Python installation, one has to follow the same steps to setup the CUDA toolkit.

Also, cuDNN has to be setup and can be downloaded from here.

Based on our experience, we had to downgrade the CUDA installation to 9.0 version and cuDNN to version 7.0 since there were a few problems with the newer versions of CUDA and cuDNN. Hope this has been resolved and updated. Once everything has been setup, the following code will run smoothly.

Once we have reached this stage, it is time to test if Tensorflow is working or not. We can start by importing it on Python.


It works like a charm and finally we have setup the environment and you can start playing around with neural nets now. Also, you can install Jupyter Notebook inside the environment if you are a notebook person. This will open in a new browser window and its easy to install with the following code

pip install jupyter

Conclusion

With these steps one can easily setup the environment required Tensorflow computations. Also, with the GPU extension, the models run exceptionally faster compared to running them on CPUs.

Share
Picture of Kishan Maladkar

Kishan Maladkar

Kishan Maladkar holds a degree in Electronics and Communication Engineering, exploring the field of Machine Learning and Artificial Intelligence. A Data Science Enthusiast who loves to read about the computational engineering and contribute towards the technology shaping our world. He is a Data Scientist by day and Gamer by night.
Related Posts

CORPORATE TRAINING PROGRAMS ON GENERATIVE AI

Generative AI Skilling for Enterprises

Our customized corporate training program on Generative AI provides a unique opportunity to empower, retain, and advance your talent.

Upcoming Large format Conference

May 30 and 31, 2024 | 📍 Bangalore, India

Download the easiest way to
stay informed

Subscribe to The Belamy: Our Weekly Newsletter

Biggest AI stories, delivered to your inbox every week.

AI Courses & Careers

Become a Certified Generative AI Engineer

AI Forum for India

Our Discord Community for AI Ecosystem, In collaboration with NVIDIA. 

Flagship Events

Rising 2024 | DE&I in Tech Summit

April 4 and 5, 2024 | 📍 Hilton Convention Center, Manyata Tech Park, Bangalore

MachineCon GCC Summit 2024

June 28 2024 | 📍Bangalore, India

MachineCon USA 2024

26 July 2024 | 583 Park Avenue, New York

Cypher India 2024

September 25-27, 2024 | 📍Bangalore, India

Cypher USA 2024

Nov 21-22 2024 | 📍Santa Clara Convention Center, California, USA

Data Engineering Summit 2024

May 30 and 31, 2024 | 📍 Bangalore, India

Subscribe to Our Newsletter

The Belamy, our weekly Newsletter is a rage. Just enter your email below.