Apr 20, 2018 # install pip in the virtual environment $ conda install pip # install Tensorflow CPU version $ pip install -upgrade tensorflow # for python 2.7 $ pip3 install -upgrade tensorflow # for python 3. Jan 01, 2020 Updated for 2020! This video walks you through a complete Python 3.7 and TensorFlow install. You will be shown the difference between Anaconda and MiniConda, and how to create an environment.
TensorFlow* is a widely-used machine learning framework in the deep learning arena, demanding efficient utilization of computational resources. In order to take full advantage of Intel® architecture and to extract maximum performance, the TensorFlow framework has been optimized using Intel® Math Kernel Library for Deep Neural Networks (Intel® MKL-DNN) primitives, a popular performance library for deep learning applications. For more information on the optimizations as well as performance data, see this blog post TensorFlow* Optimizations on Modern Intel® Architecture .
Anaconda* has now made it convenient for the AI community to enable high-performance-computing in TensorFlow. Starting from TensorFlow v1.9, Anaconda has and will continue to build TensorFlow using Intel® Math Kernel Library for Deep Neural Networks (Intel® MKL-DNN) primitives to deliver maximum performance in your CPU.
This install guide features several methods to obtain Intel Optimized TensorFlow including off-the-shelf packages or building one from source that are conveniently categorized into Binaries, Docker Images, Build from Source.
Quick LinksAnaconda
*Supports Py27, Py36 and Py37
PIP Wheels
Docker Containers
Build from source
1. BinariesInstall the latest Intel® Optimization for TensorFlow* from Anaconda* Cloud
Available for Linux*, Windows*, MacOS* Nvidia universal driver for macos 10.13.
TensorFlow* version: 2.2.0
Installation instructions:
If you don't have conda package manager, download and install Anaconda
Linux and MacOS![]() ![]()
Open Anaconda prompt and use the following instruction
In case your anaconda channel is not the highest priority channel by default(or you are not sure), use the following command to make sure you get the right TensorFlow with Intel optimizations
Windows
Open Anaconda prompt and use the following instruction
(or)
Besides the install method described above, Intel Optimization for TensorFlow is distributed as wheels, docker images and conda package on Intel channel. Follow one of the installation procedures to get Intel-optimized TensorFlow.
Note: All binaries distributed by Intel were built against the TensorFlow v2.0 tag in a centOS container with gcc 4.8.5 and glibc 2.17 with the following compiler flags (shown below as passed to bazel*)
Install the latest Intel® Optimization for TensorFlow* from Intel Channel
Available for Linux*
TensorFlow* version: 2.1.0
Installation instructions:
Open Anaconda prompt and use the following instruction. Available for Python 3.6 and 3.7. Hp scanner for mac yosemite.
Get Intel® Optimization for TensorFlow* from Intel® Distribution for Python
Available for Linux*
TensorFlow* version: 2.1.0
Installation instructions:
Open Anaconda prompt and use the following instruction. Available for Python 3.6 and 3.7.
(or)
Install the Intel® Optimization for TensorFlow* Wheel Into an Existing Python* Installation Through PIP
Available for Linux*
TensorFlow version: 2.1.0
Installation instructions:
Note:
For TensorFlow versions 1.13, 1.14 and 1.15 with pip > 20.0, if you experience invalid wheel error, try to downgrade the pip version to <20.0
For e.g
Run the below instruction to install the wheel into an existing Python* installation, preferably Intel® Distribution for Python*. Python versions supported are 3.5, 3.6, 3.7
Note than for 1.14.0 install we have fixed a few vulnerabilities and the corrected versions can be installed using the below commands. We identified new CVE issues from curl and GCP support in the previous pypi package release, so we had to introduce a new set of fixed packages in PyPI
Warning on ISA above AVX2: Download iphoto for mac os x yosemite.
'This TensorFlow binary is optimized with Intel(R) MKL-DNN to use the following CPU instructions in performance critical operations: <missing_instructions>. To enable them in non-MKL-DNN operations, rebuild TensorFlow with the appropriate compiler flags.'
Older CPUs may not support this version of TensorFlow and may result in 'Illegal instruction (core dumped)' error.
2. Docker ImagesGet Intel® Optimization for TensorFlow* Docker ImagesGoogle DL Containers
Starting version 1.14, Google released DL containers for TensorFlow on CPU optimized with Intel MKL DNN by default. The TensorFlow CPU container names are in the format 'tf-cpu.<framework version>' and support Python3. Below is a sample command to download the docker image locally and launch the container for TensorFlow 1.14
This command will start the TensorFlow 1.14 with MKL DNN enabled in detached mode, bind the running Jupyter server to port 8080 on the local machine, and mount local /home directory to /home in the container. The running JupyterLab instance can be accessed at localhost:8080.
To launch an interactive bash instance of the docker container, run the below command
Obtaining and Running Intel Containers
These docker images are all published at http://hub.docker.com in intelaipg/intel-optimized-tensorflow namespace and can be pulled with the following command:
For example, to run the data science container directly, simply
And then go to your browser on http://localhost:8888/
For those who want to navigate through the browser, follow the link Available Container Configurations
The following tags/configurations are available:
To get the latest Release Notes on Intel-optimized TensorFlow, please refer this article
3. Build from SourceBuild TensorFlow from Source with Intel® MKLLinux build
Building TensorFlow from source is not recommended. However, if instructions provided above do not work due to unsupported ISA, you can always build from source.
Building TensorFlow from source code requires Bazel installation, refer to the instructions here, Installing Bazel.
Installation instructions:
Flags set in the command below will add AVX, AVX2 and AVX512 instructions which will result in 'illegal instruction' errors when you use older CPUs. If you want to build on older CPUs, set the instruction flags accordingly
3. Install the optimized TensorFlow wheel
Windows Build
Prerequisites
Install the below Visual C++ 2015 build tools from https://visualstudio.microsoft.com/vs/older-downloads/
Installation
Tensorflow For Python 2.7 Macos Windows
3. Bazel build with the with 'mkl' flag and the 'output_dir' to use the right mkl libs
Tensorflow For Python 2.7 Macos Free
4. Install the optimized TensorFlow wheel
Sanity Check
Once Intel-optimized TensorFlow is installed, running the below command must print 'True' if Intel MKLDNN optimizations are present.
TensorFlow 1.* versions
Additional Capabilities and Known Issues
Tensorflow On Python 2.7SupportTensorflow For Python 2.7 Macos Download
If you have further questions or need support on your workload optimization, Please submit your queries at the TensorFlow GitHub issues with the label 'comp:mkl' or the Intel AI Frameworks forum.
Useful ResourcesArchived WheelsTensorflow For Python 2.7 Macos X
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2020
Categories |