Git Product home page Git Product logo

tensorflow-1.4.2-avx-mkl's Introduction

tensorflow-1.4.2 enable AVX MKL

Environment:

ubuntu 18.04 (or other linux), x86-64, python 2.7

enable SSE4.1 SSE4.2 AVX AVX2 FMA: whl link

enable MKL: whl link

How to use?

install tensorflow that enable AVX SSE FMA:

wget https://github.com/Ding-Kyoma/tensorflow-1.4.2-AVX-MKL/releases/download/v1.0/tensorflow-1.4.2-cp27-cp27mu-linux_x86_64.whl
pip install tensorflow-1.4.2-cp27-cp27mu-linux_x86_64.whl

How to build?

1. Check which tensorflow & python & Bazel & gcc version you need install

https://www.tensorflow.org/install/source#linux

2. install python

sudo apt install python-dev python-pip for python 2.7 or sudo apt install python3-dev python3-pip for python 3.6

3. Install Bazel

other Bazel version

sudo apt install g++ unzip zip
wget https://github.com/bazelbuild/bazel/releases/download/0.5.4/bazel-0.5.4-installer-linux-x86_64.sh
chmod +x bazel-0.5.4-installer-linux-x86_64.sh
./bazel-0.5.4-installer-linux-x86_64.sh --user

vim ~/.bashrc

add export PATH="$PATH:$HOME/bin" in .bashrc

source ~/.bashrc

4. Install gcc

sudo vim /etc/apt/sources.list

add this 2 line to sources.list

deb http://dk.archive.ubuntu.com/ubuntu/ xenial main
deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe
sudo apt update
sudo apt-get install gcc-4.8
sudo apt-get install g++-4.8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 20
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 20
gcc --version

5. Download TensorFlow

pip install -U --user pip numpy wheel
pip install -U --user keras_preprocessing --no-deps
git clone https://github.com/tensorflow/tensorflow.git
cd tensorflow
git checkout r1.4     # r1.4 is tensorflow 1.4.2
./configure           # all No

6. Build

build With AVX2/FMA/etc.

bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package     # take time
bazel-bin/tensorflow/tools/pip_package/build_pip_package ~/tensorflow_pkg

pip install ~/tensorflow_pkg/tensorflow-1.8.0-cp27-cp27mu-linux_x86_64.whl    # install tensorflow with AVX2/FMA
build With MKL
bazel build --config=opt --config=mkl //tensorflow/tools/pip_package:build_pip_package      # take time
bazel-bin/tensorflow/tools/pip_package/build_pip_package ~/tensorflow_pkg_mkl

pip install ~/tensorflow_pkg_mkl/tensorflow-1.8.0-cp27-cp27mu-linux_x86_64.whl              # install tensorflow with MKL

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.