Set up Anaconda, Jupyter Notebook, Tensorflow for Deep Learning
Over the last few weeks I have been getting my hands dirty with deep learning and all things Data Science. It is proving to be 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.
I have trialled and error-ed a few times, exploring the capabilities of various programming languages, but the overall languages, that seem to be the defacto standard are Python & R.
As with any other Programming languages and Tools there are always a multitude of tools and frameworks one needs to learn and become familiar with in order to try and get the best out of them. You can spend and waste countless hours learning how to install and configure the various data science packages like Numpy, Matplotlib, spacy, nltk etc. , trying to solve the various package dependencies.
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: Utilize the right mix of tools to create high-performance data science applications , because it will provide you with a thorough grounding on Anaconda to get you up and running in no time.
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)
- Why every business needs a web maintenance retainer - March 11, 2019
- Connect AWS Lightsail SSH with ubuntu terminal - March 1, 2019
- Set up Anaconda, Jupyter Notebook, Tensorflow for Deep Learning - February 20, 2019