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

  • 相关阅读:
    oracle级联删除
    sqlserver 中批量删除 换行符
    SpringBoot与jackson.databind兼容报错问题
    mvn 本地jar包 加入自己的maven仓库
    sql server 表2字段更新到表1,mysql
    sql server 修改表字段
    Spring Boot文件上传
    java如何实现多继承(实现:子类中二个方法,分别继承不同父类)
    SQL SERVER 数据库如何限制一列不能重复(已经有主键)
    SQL server 字段合并CAST(org_no AS VARCHAR(20))+CAST(page_no AS VARCHAR(20))+CAST(djlb_no AS VARCHAR(20)))
  • 原文地址:https://www.cnblogs.com/serena45/p/5716230.html
Copyright © 2011-2022 走看看