Set up Anaconda, Jupyter Notebook, Tensorflow for Deep Learning
Data Science is one of those disciplines of Computer Science where there is just a whole lot going on, loads to learn and where things just don’t always seem to work the way you would expect.
This is where Anaconda becomes your best friend and eases the frustration of getting started. The Anaconda distribution comes with more than 1000 data packages and includes the
In this post, we’ll explore how to get started with Tensorflow & Keras using Jupyter Notebook to get started with Deep Learning.
Jupyter Notebook is really helpful to start getting familiar with whatever you want to try achieve in your data science project.
I, personally recommend using Anaconda Navigator, the desktop Graphical User I
I recommend reading Hands-On Data Science with Anaconda
Create a new Conda Environment
Although, I recommend using the Anaconda GUI to create and configure your data science environments. I also realise that developers will often prefer to use the terminal window to do so.
The following is the process I go through to create new environments using the terminal window.
Once you have installed Anaconda, all your environments will be located in
Before creating a new environment it’s always worth checking that you have the latest version conda installed
We can now create a new environment, by either using the default configured python version or a particular version of python
After your new environment has been created you will need to activate it.
Once activated you can check the configuration of your environment and explore what packages have been installed
You can now install any package you like using the terminal commands. In this
You can also explore to see what other environments you have created
If ever you need to delete an environment you can do so using
There are a number of ways you can install TensorFlow and you can do so by making use
One key benefit of installing TensorFlow using
Additionally, any of the 1,400+ professionally built packages in the Anaconda repository can be installed alongside TensorFlow to provide a complete data science environment.
You can install into you existing environment using
If you are already in your activated environment you can simply use
If you want to use the GPU package of tensorflow you can use
Many of the functions in TensorFlow can be accelerated using NVIDIA GPUs. The gain in acceleration can be especially large when running computationally demanding deep learning applications.
When installing TensorFlow using pip, the CUDA and
When the GPU accelerated version of TensorFlow is installed using
To verify you have successfully installed Tensorflow, you can simply invoke you python shell in your environment.
Then create a simple tensorflow Hello World application
If you see
Hello, TensorFlow! printed then it confirms that TensorFlow is installed correctly.
Tensorflow 1.12 includes an implementation of the Keras API, known as tf.keras.
Previously Keras had to be installed as a
The Tensorflow package available in the Anaconda-Navigator is Tensorflow
Installing Jupyter Notebook
If you’re using
anaconda-navigator you can easily install Jupyter Notebook using the convenient UI , which you can also access a number great Data Science specific applications
If you create your new environment using
anaconda-navigator Jupyter Notebook is installed by default.
However, when creating an environment using the terminal you will need to an additional step to install Jupyter Notebook
Once the installation is complete you can now start Jupyter Notebook
This will open a browser session and you will see your Jupyter Notebook available
Verify your Environment
You can now verify you have your environment configured correctly by creating a new python notebook and writing a simple application to verify the details.
Your Jupyter Notebook should respond with
Anaconda provides a simpler, faster experience using the excellent TensorFlow library. It takes significant time and effort to add support for the many platforms used in production, and to ensure that the accelerated code is still stable and mathematically correct.
A unique background as business owner, marketing, software development and business development ensures that he can offer the optimum business consultancy services across a wide spectrum of business challenges.
Latest posts by Gary Woodfine (see all)
- How to convert Word Documents to Text Files with Python - May 22, 2019
- How to start a new project using Vue.js - April 29, 2019
- How to install DynamoDb on local Ubuntu Development - April 17, 2019