TensorFlow - 1 - Install and get start on Ubuntu 12

前端之家收集整理的这篇文章主要介绍了TensorFlow - 1 - Install and get start on Ubuntu 12前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

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


二、源码级安装:

1. 安装JDK8:

$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java8-installe r

2. 安装Bazel:

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总算可以了~


3. Download tensorflow and install other dependencies:

$ mkdir tensorflow
$ 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-bin/tensorflow/cc/tutorials_example_trainer --use_gpu

$ 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"

原文链接:https://www.f2er.com/ubuntu/354704.html

猜你在找的Ubuntu相关文章