Reference: http://www.tensorfly.cn/tfdoc/get_started/os_setup.html
https://zhuanlan.zhihu.com/p/24055668
一、简单安装:
$ sudo pip install tensorflow
$ python
<<< import tensorflow as tf
二、源码级安装:
$ sudo apt-get update
$ sudo apt-get install oracle-java8-installe r
From: http://blog.csdn.net/idwtwt/article/details/52332640
更新bazel版本:
$ echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
$ curl https://storage.googleapis.com/bazel-apt/doc/apt-key.pub.gpg | sudo apt-key add -
sudo apt-get update && sudo apt-get install bazel
sudo apt-get upgrade bazel或者直接去下载安装器:https://github.com/bazelbuild/bazel/releases总算可以了~
$ cd tensorflow
$ git clone --recurse-submodules https://github.com/tensorflow/tensorflow
$ sudo apt-get install python-numpy swig python-dev
$ ./configure
4. CompileTensorflow:
$ bazel build -c opt --config=cuda //tensorflow/cc:tutorials_example_trainer
$ bazel build "//tensorflow:*"
附:Bazel编译
$ git clone https://github.com/bazelbuild/bazel.git $ cd bazel $ git checkout tags/0.1.0 $ ./compile.sh $ export PATH=$PATH:"output of babel"