I am stuck on the issue of receiving base64 encoded images in TensorFlow model these days. I have read a lot of information, but I still haven’t found a satisfactory solution. Stop Installing Tensorflow using PIP for Performance Sake! , link address: towardsdatascience.com/stop-instal…
Stop installing Tensorflow with PIP! Please use Conda instead. You don’t know what a conda is? It is a cross-platform open source software package and environment management system for Mac, Windows and Linux. If you are not already using Conda, I suggest you start making it, as it can make managing your data science tools more enjoyable.
Here are two very important reasons to install Tensorflow using Conda instead of PIP.
Faster CPU performance
The Conda Tensorflow package, starting with version 1.9.0, utilizes the Intel Mathematics Core library for Deep Neural networks (McL-dnn). The library provides a huge performance boost. This chart proves it!
The chart from https://www.anaconda.com/blog/developer-blog/tensorflow-in-anaconda/
As you can see, the Tensorflow performance of a Conda installation provides a speed increase of over 8 times compared to a PIP installation. This is useful for people who use the CPU a lot for training and reasoning. As a machine learning engineer, I run training code using CPU tests and then push it to gPU-enabled machines. This speed increase helped me iterate faster. I do as much reasoning on the CPU as POSSIBLE, so this will help optimize my model performance.
The MKL library accelerates not only Tensorflow packages but also other widely used libraries such as NumPy, NumpyExr, SciPy, and SciKit-learn!
The GPU version is easier to install
Conda automatically installs CUDA and CuDNN libraries required for GPU support, whereas PIP installations require you to do this manually. Everyone likes to do it all at once, especially when it comes to downloading libraries.
Quick start
I hope these two reasons are enough for you to switch to Conda. If you are sure, start with this step.
pip uninstall tensorflow
Copy the code
If you haven’t already installed Anaconda or Miniconda, please do. Miniconda simply installs Conda and its dependencies, whereas Anaconda preinstalls many packages. I prefer Miniconda. Try this after installing Conda.
conda install tensorflow
Copy the code
If the GPU version is used, replace TensorFlow with tensorFlow – GPU.
In addition to making using Tensorflow faster and easier, Conda provides other toolsets that are easier to integrate into your workflow. One of my favorite features is their virtual environment capabilities. You can read more about Conda and TensorFlow here. There is more information about MKL optimization here.
Hope this article was helpful to you, thanks for reading!