TensorFlow - 1 - Install and get start on Ubuntu 12

    xiaoxiao2021-03-26  30

    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. Compile Tensorflow: 

    从源码树的根路径执行: $ 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://ju.6miu.com/read-661975.html

    最新回复(0)