Ubuntu16.04编译Tensorflow1.10.1

1 安装JDK

apt-get install openjdk-8-jdk

2 安装bazel

到 https://github.com/bazelbuild/bazel/releases 去下载 bazel-0.16.1-installer-linux-x86_64.sh ,然后执行:
sh bazel-0.16.1-installer-linux-x86_64.sh 
来安装bazel。

3 安装 nccl

tensorflow 1.10.1 需要用到nccl,可以到 https://developer.nvidia.com/nccl 下载最新版本。建议选择”NCCL <version> O/S agnostic and cuda xx”,直接拷贝到对应cuda目录就好。

4 编译 tensorflow/
到 https://github.com/tensorflow/tensorflow/releases 下载 tensorflow-1.10.1.tar.gz,然后执行以下命令:

tar zxvf tensorflow-1.10.1.tar.gz

cd tensorflow-1.10.1

./configure

bazel build --verbose_failures --config=opt --config=cuda --copt=-mavx --copt=-mavx2 --copt=-mfma --copt=-mfpmath=both --copt=-msse4.2 -k //tensorflow/tools/pip_package:build_pip_package

bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg

pip install /tmp/tensorflow_pkg/tensorflow-1.10.1-cp35-cp35m-linux_x86_64.whl

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值