TensorFlow安装(安装bazel,配置TensorFlow编译环境,利用源码安装TensorFlow)

本文详细介绍了如何手动安装TensorFlow,包括安装Bazel,配置TensorFlow编译环境,以及使用bazel编译并用pip安装TensorFlow。首先,需要安装JDK 8和Bazel,接着克隆TensorFlow源码并进行配置,选择所需的编译选项如CUDA支持。最后,使用bazel构建pip包并进行安装。过程中可能会遇到的问题包括CUDA版本选择和编译错误等。
摘要由CSDN通过智能技术生成

1、安装 Bazel

在安装 bazel 时,要先安装 JDK8(按照官方网站安装就没问题:https://docs.bazel.build/versions/master/install.html)

1. Install JDK 8

Install JDK 8 by using:

sudo apt-get install openjdk-8-jdk

On Ubuntu 14.04 LTS you'll have to use a PPA:

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

2. Add Bazel distribution URI as a package source (one time setup)

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 -

If you want to install the testing version of Bazel, replace stable withtesting.

3. Install and update Bazel

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

Once installed, you can upgrade to a newer version of Bazel with:

sudo apt-get upgrade bazel


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值