zoukankan      html  css  js  c++  java
  • 安装tensorflow

    官网:http://tensorflow.org/
    安装步骤:
    1、sudo apt-get install python-pip python-dev python-virtualenv

    3    conda install tensorflow

    4、source activate tensorflow

    5、(tensorflow)$ pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.9.0-py3-none-any.whl

    至于网址:

    -------------------------------

    # Ubuntu/Linux 64-bit, CPU only, Python 2.7
    (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.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.
    (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl
    
    # Mac OS X, CPU only, Python 2.7:
    (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/tensorflow-0.9.0-py2-none-any.whl
    
    # Ubuntu/Linux 64-bit, CPU only, Python 3.4
    (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.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.
    (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0-cp34-cp34m-linux_x86_64.whl
    
    # Ubuntu/Linux 64-bit, CPU only, Python 3.5
    (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.0-cp35-cp35m-linux_x86_64.whl
    
    # Ubuntu/Linux 64-bit, GPU enabled, Python 3.5
    # Requires CUDA toolkit 7.5 and CuDNN v4. For other versions, see "Install from sources" below.
    (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0-cp35-cp35m-linux_x86_64.whl
    
    # Mac OS X, CPU only, Python 3.4 or 3.5:
    (tensorflow)$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/tensorflow-0.9.0-py3-none-any.whl
    ----------------------------

    测试:

    1、打开终端输入cd tensorflow

    2、source bin/activate

    3、python

    4、输入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
    >>>

    5、测试成功接下来首先退出python 按快捷键Ctrl+D

    6、再退出tensorflow 在命令行输入命令:deactivate

  • 相关阅读:
    理解java容器底层原理--手动实现HashSet
    理解java容器底层原理--手动实现HashMap
    理解java容器底层原理--手动实现LinkedList
    理解java容器底层原理--手动实现ArrayList
    Java 集合框架总结--导图
    java 容器(collection)--ArrayList 常用方法分析 源码分析
    java 递归及其经典应用--求阶乘、打印文件信息、计算斐波那契数列
    (四)消息中间件-面试问答
    (四)linux下开机自启
    (十)Dockfile创建Nginx镜像
  • 原文地址:https://www.cnblogs.com/serena45/p/5716230.html
Copyright © 2011-2022 走看看