bazel 安装与手动安装tensorflow

1 . 安装bazel 需要的jdk-8

sudo apt-get install openjdk-8-jdk

在Ubuntu 14.04 LTS上,您必须使用PPA:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update && sudo apt-get install oracle-java8-installer

第2步:添加Bazel分发URI作为包源

echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add -

如果您想安装Bazel的测试版本,请stable用testing。

第3步:安装并更新Bazel

sudo apt-get update && sudo apt-get install bazel

安装完成后,可以使用以下命令升级到较新版本的Bazel:

sudo apt-get upgrade bazel

方法2:
安装固定的版本

$ BAZEL_VERSION="0.26.0"     # insert your desired version here, for example 0.26.0
$ wget https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-installer-linux-x86_64.sh   # if not on x86_64, change that too
$ chmod +x bazel-${BAZEL_VERSION}-installer-linux-x86_64.sh   # or the file you just downloaded
$ ./bazel-${BAZEL_VERSION}-installer-linux-x86_64.sh
$ bazel version   # this should now print the same as BAZEL_VERSION

手动编译安装 TensorFlow

bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package --verbose_failures

# 构建 whl 包
bazel-bin/tensorflow/tools/pip_package/build_pip_package ~/tmp

# 安装tensorflow
pip install ~/tmp/tensorflow-2.0.1-cp37-cp37m-linux_x86_64.whl --user
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

蓝鲸123

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值