TypechoJoeTheme

半醉残影

统计

源码编译TensorFlow with MKLDNN

2018-05-14
/
8 评论
/
1,388 阅读
/
正在检测是否收录...
05/14

Install TensorFlow

Operating Systems:

  • Ubuntu* 16.04.3 long-term support (LTS), 64-bit
  • CentOS* 7.4, 64-bit
  • Yocto Project Poky Jethro v2.0.3, 64-bit (for target only)

Install Python Environment

Anaconda includes 250+ popular data science packages and the conda package and virtual environment manager for Windows, Linux, and MacOS. Conda makes it quick and easy to install, run, and upgrade complex data science and machine learning environments like Scikit-learn, TensorFlow, and SciPy. Anaconda Distribution is the foundation of millions of data science projects as well as Amazon Web.

please use root rights

$ su
  1. Download
$ wget -c https://repo.anaconda.com/archive/Anaconda3-5.1.0-Linux-x86_64.sh
$ wget -c https://repo.anaconda.com/archive/Anaconda2-5.3.0-Linux-x86_64.sh
  1. Install Anaconda
$ chmod +x Anaconda3-5.1.0-Linux-x86_64.sh
$ ./Anaconda3-5.1.0-Linux-x86_64.sh
$ source ~/.bashrc

Install Bazel

Bazel is the common build tool. It's necessary to build TensorFlow source code.

  1. Download
$ wget -c https://github.com/bazelbuild/bazel/releases/download/0.13.1/bazel-0.13.1-installer-linux-x86_64.sh
  1. Install
$ chmod +x bazel-0.13.1-installer-linux-x86_64.sh
$ ./bazel-0.13.1-installer-linux-x86_64.sh --prefix=$INSTALL_HOME/bazel

NOTE: "INSTALL_HOME" is your install directory.

  1. Add environment

Add bazel enviroment to .bashrc file.

$ vim ~/.bashrc

add bazel Enviroment

export PATH="$INSTALL_HOME/bazel/bin:$PATH"

$ source ~/.bashrc

Install TensorFlow

  1. Download TensorFlow source code.
$ git clone https://github.com/tensorflow/tensorflow.git
$ cd tensorflow
  1. Build

Choose what you need tools.

$ ./configure

# it may for a long time.
$ bazel build --config=mkl --copt="-DEIGEN_USE_VML" -c opt //tensorflow/tools/pip_package:build_pip_package

$ bazel build --copt=-mavx2 --copt=-mfma --copt=-mavx --copt=-msse4.2 --copt=-msse4.1 --copt=-msse3 --copt="-DEIGEN_USE_VML" -c opt //tensorflow/tools/pip_package:build_pip_package
  1. Generate install package
$ mkdir build_pip_package
$ bazel-bin/tensorflow/tools/pip_package/build_pip_package ./build_pip_package
  1. Install TensorFlow pip package
$ sudo pip install ./build_pip_package/tensorflow-1.8.0-cp36-cp36m-linux_x86_64.whl

NOTE: It may need root rights

  1. Validate
$ python
# input "import tensorflow as tf",it should be have no error.
>>> import tensorflow as tf

End

编译TensorFlow 1.10需要安装如下

pip install keras_applications==1.0.4 --no-deps
pip install keras_preprocessing==1.0.2 --no-deps
pip install h5py==2.8.0

更多详情点击这里

TensorFlowAI深度学习
朗读
赞(0)
赞赏
感谢您的支持,我会继续努力哒!

三合一收款

下面三种方式都支持哦

微信
QQ
支付宝
打开支付宝/微信/QQ扫一扫,即可进行扫码打赏哦
版权属于:

半醉残影

本文链接:

https://blog.dengyb.com/archives/14/(转载时请注明本文出处及文章链接)

评论 (8)
  1. illppfuedk 作者
    Windows 10 · Google Chrome

    看的我热血沸腾啊

    2024-09-23 回复
  2. svmeayjcco 作者
    Windows 10 · Google Chrome

    真棒!

    2024-11-20 回复
  3. ahhhsrcnaa 作者
    Windows 10 · Google Chrome

    你的文章让我心情愉悦,真是太棒了! http://www.55baobei.com/HukYv66NTJ.html

    2024-11-21 回复
  4. lxgxuncwki 作者
    Windows 10 · Google Chrome

    《麦香》国产剧高清在线免费观看:https://www.jgz518.com/xingkong/32968.html

    2024-11-22 回复
  5. krwvutsrzl 作者
    Windows 10 · Google Chrome

    你的文章充满了欢乐,让人忍不住一笑。 https://www.yonboz.com/video/41197.html

    2024-11-25 回复
  6. uoptxknmmj 作者
    Windows 10 · Google Chrome

    《麦香》国产剧高清在线免费观看:https://www.jgz518.com/xingkong/32968.html

    2024-11-26 回复
  7. bpiutsdbaa 作者
    Windows 10 · Google Chrome

    你的文章总是能给我带来欢乐,谢谢你! http://www.55baobei.com/SK4nTZpQzJ.html

    2024-12-03 回复
  8. axykonmljy 作者
    Windows 10 · Google Chrome

    你的文章总是能给我带来欢乐,谢谢你! http://www.55baobei.com/xtmRPozM7D.html

    2024-12-15 回复