This will install Python 3.6. The default install location is $HOME/anaconda3, so any user can install a private copy. I chose to install it at system location /opt/anaconda3 and thus made it available to all users.
This will install Python 2.7. The default install location is $HOME/anaconda2, so any user can install a private copy. I chose to install it at system location /opt/anaconda2 and thus made it available to all users.
4) Update Anaconda 2:
Note here we use module to facilitate the usage of multiple Python distributions on Hydra.
One crucial reason that Anaconda Python provides much higher performance than the stock Python is that it uses the highly optimized Intel MKL for some of most popular numerical/scientific Python libraries, including NumPy, SciPy & Scikit-Learn:
Incorrect way of installing TensorFlow with Anaconda
Before I show you the proper way of installing TensorFlow with Anaconda, I’d like to point out that there are a couple of deficiencies in the official TensorFlow documentation on Installing with Anaconda. Let’s follow the instructions step-by-step.
1) We’ve already downloaded and installed Anaconda.
2) Create a conda environment named tensorflow to run Python 3.6 (as an unprivileged user):
3) Activate the conda environment:
4) Install the latest TensorFlow release (1.4.0 as of this writing) inside the conda environment:
However, when I tried to import the tensorflow module, I got an error:
Apparently, the module was compiled against the wrong Python version! Admittedly, it might work to install TensorFlow this way with earlier Python versions, such as 2.7 and 3.5; but not with 3.6!
In the above output we note that numpy was also installed in the conda environment, as a dependency of TensorFlow. However, this numpy module is not built with MKL, but rather with OpenBLAS!
The OpenBLAS libraries are presumably located in /usr/local/lib. However, that directory is empty!
It’s not worth our time to investigate further. Let’s deactivate the conda environment:
then remove the conda environment:
Proper way of installing TensorFlow with Anaconda
In fact, Conda provides TensorFlow packages in its default channel / repository! As of this writing, the latest TensorFlow version in the default channel is 1.3.0, which is slightly behind the latest official release of TensorFlow (1.4.0).
Installing TensorFlow is easy:
Note Conda installed its own copy of CUDA 8.0 & cuDNN 6.0 in Anaconda, so it doesn’t depend upon external CUDA & cuDNN libraries to function!
Similarly, we’ve also installed TensorFlow with Anaconda2:
Installing Keras with Anaconda
At this point, it should be no surprise that Keras is also included in the default conda channel; so installing Keras is also a breeze.