• tensorflow Ubuntu 64 安装


    本机是ubuntu  64位操作系统 。

    安装:

    首先安装pip

    sudo apt-get install python-pip python-dev
    

     安装成功之后安装 tensorflow

    如果Python是2版本的请使用下面命令:

    # Ubuntu/Linux 64-bit, CPU only, Python 2.7:
    $ sudo pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0-cp27-none-linux_x86_64.whl
    
    # Ubuntu/Linux 64-bit, GPU enabled, Python 2.7. Requires CUDA toolkit 7.5 and CuDNN v4.
    # For other versions, see "Install from sources" below.
    $ sudo pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.8.0-cp27-none-linux_x86_64.whl
    

     如果Python版本是3使用下面命令:

    # Ubuntu/Linux 64-bit, CPU only, Python 3.4:
    $ sudo pip3 install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0-cp34-cp34m-linux_x86_64.whl
    
    # Ubuntu/Linux 64-bit, GPU enabled, Python 3.4. Requires CUDA toolkit 7.5 and CuDNN v4.
    # For other versions, see "Install from sources" below.
    $ sudo pip3 install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.8.0-cp34-cp34m-linux_x86_64.whl
    

    下载安装成功之后我们进行测试:

    $ python
    
    >>> import tensorflow as tf
    >>> hello = tf.constant('Hello, TensorFlow!')
    >>> sess = tf.Session()
    >>> print sess.run(hello)
    Hello, TensorFlow!
    >>> a = tf.constant(10)
    >>> b = tf.constant(32)
    >>> print sess.run(a+b)
    42
    >>>
    
  • 相关阅读:
    一套测试题
    静态成员与友元
    grids2742
    [转]CentOS添加第三方yum源
    Linux软件包管理
    类的基本概念
    2012百度实习生笔试题(c++方向)
    anyview 数据结构习题集 第1章答案
    Linux常用命令
    anyview 数据结构习题集 第2章答案
  • 原文地址:https://www.cnblogs.com/tong775131501/p/6266775.html
Copyright © 2020-2023  润新知