Google’s TensorFlow framework enables computer calculations to be distributed between multiple CPUs and GPUs. This parallelization is very useful for accelerating Machine Learning training, and many developers and data scientists exploit this tool.
The official Tensorflow website provides instructions for installation on a macOS environment. These official instructions are available at the following address.
There are also instructions for virtualenv, a native pip environment, using a Docker container, an Anaconda command line or from various sources. On the other hand, the official site does not provide instructions for installation on an Anaconda Navigator application environment.
As a reminder, Anaconda is a free, open-source development environment for Python and R. With Anaconda, management of libraries and configurable environments is simplified and automated.
It’s also an excellent starting point for experimenting with Data Science and Machine Learning packages. More and more TensorFlow libraries are compatible with Anaconda.
Anaconda Navigator is a graphical user interface based on Anaconda. It facilitates the management of packages, environments and channels.
Install Anaconda-Navigator
To get started, download Anaconda from the official website and install it by following the instructions.Be sure to install the latest update.
You can force the update using a command-line interface and this command: “$ conda update anaconda anaconda-navigator”.
Then launch the Anaconda-Navigator application. In this application, choose Environments from the column menu on the left.
By default, you’ll find a Root environment. You can set up multiple environments with different configurations.
It’s best to update existing packages to the latest versions. Also install the latest version of the Python language.
Select the “Environments” item in the column menu on the left, and choose the environment to be updated. In this case, the “Root” environment.
Select “Upgradable” from the drop-down menu. Select the version number in the Version column to define the package to be upgraded.
Make sure Python is up to date, then click “Apply”.
Create a new environment to install Tensorflow packages
A new environment can be created to install TensorFlow packages. This environment will contain the basic packages required. The latest version of Python and Tensorflow will be installed.
Click on the “Create” button at the bottom of the Environments column. In the menu that opens, type “Tensorflow” in the “Name” text field. Check the Python box, and select the latest version. Click on “Create”.
The Tensorflow packages can now be installed in the new environment. In the top-right drop-down menu, select “Not Installed”. Type “tensorflow” in the Search Packages text field and click Return. Check the box in the left-hand column next to the two tensorflow package names. Click on Apply.
All that remains is to validate the installation using the new Tensorflow environment. Make sure it is selected, then click on the arrow next to the Tensorflow environment name. Select “Open with IPython”, and a terminal window appears with the environment parameters.
Following the recommendations on the official Tensorflow website, type this command in the terminal window:
import tensorflow as tf
hello = tf.constant (‘Hello, TensorFlow! ‘)
sess = tf.Session ()
print (sess.run(hello))
The new environment you’ve just installed and configured is ready for development with tensorflow. In the event of an error, please check that you have followed the instructions correctly.
How do I learn to use TensorFlow?
As a key Machine Learning tool, TensorFlow is indispensable in Data Science. To learn how to use it, you can choose DataScientest training courses.
The Deep Learning module of our Data Scientist training course covers TensorFlow, KERAS and the CNN and RNN neural networks. The other modules in this curriculum cover Python programming, DataViz, Machine Learning, Big Data, databases and AI systems.
At the end of the course, you’ll have all the skills you need to become a Data Scientist. A certificate issued by MINES ParisTech / PSL Executive Education as part of our partnership validates your expertise.
This program can be completed in nine months of Continuing Education, or in 11 weeks in intensive BootCamp mode. Over 80% of our alumni find immediate employment.
If you already have experience in Data Science, you can choose our Deep Learning expert course. This 10-week Continuing Education course enables you to perfect your programming skills, learn to manipulate Keras and TensorFlow, and master AI techniques such as Computer Vision and Natural Language Processing.
Our Blended Learning format combines distance learning on our coached online platform and collective Masterclasses.
All our training courses are eligible for state financing. Don’t wait any longer and discover DataScientest’s training courses!
Now you know how to install TensorFlow on Anaconda for macOS. For more information, see our complete dossier on TensorFlow, and our introduction to Deep Learning.