Python Deep Learning Environment Setup

Python Deep Learning Environment Setup

In this chapter, we will learn about setting up an environment for Python deep learning. We must install the following software to create deep learning algorithms.

  • Python 2.7 and above
  • Scipy
  • with Numpy

  • Matplotlib
  • Theano
  • Keras
  • TensorFlow

It is strongly recommended to install Python,

We need to make sure the different types of software are installed correctly.

Let’s go to our command prompt and type the following command –

$ python
Python 3.6.3 |Anaconda custom (32-bit)| (default, Oct 13 2017, 14:21:34)
[GCC 7.2.0] on linux

Next, we can import the required libraries and print their versions:

import numpy
print numpy.__version__

Output

1.14.2

Installing Theano, TensorFlow, and Keras

Before we begin installing the packages—Theano, TensorFlow, and Keras—we need to make sure pip is installed. The package management system in Anaconda is called pip.

To confirm pip’s installation, enter the following in the command line.

$ pip

Once pip’s installation is confirmed, we can install TensorFlow and Keras by executing the following commands:

$ pip install theano
$ pip install tensorflow
$ pip install keras

Confirm Theano’s installation by executing the following line of code:

$ python –c "import theano: print (theano.__version__)"

Output

1.0.1

Confirm Tensorflow’s installation by executing the following line of code:

$python –c “import tensorflow: print tensorflow.__version__”

Output

1.7.0

Confirm Keras installation by executing the following line of code:

$python –c “import keras: print keras.__version__”
Using TensorFlow backend

Output

2.1.5

Leave a Reply

Your email address will not be published. Required fields are marked *