zoukankan      html  css  js  c++  java
  • windows下Anaconda3配置TensorFlow深度学习库

    Anaconda3(python3.6)安装tensorflow

    Anaconda3中安装tensorflow3是非常简单的,仅需通过

    pip install tensorflow

    测试代码:

    import tensorflow as tf
    >>> hello =tf.constant("Hello TensorFlow~")
    >>> soss=tf.Session()
    >>> print(soss.run(hello))
    b'Hello TensorFlow~'
    >>> a=tf.constant(10)
    >>> b=tf.constant(32)
    >>> print(soss.run(a+b))  #輸出42

    下面文章是之前在Anaconda3中配置Tensorflow库的过程

    Anaconda3(python3.5)配置TensorFlow深度学习库

    前言:目前Google已经发布了TensorFlow的Windows版本,只支持64位Python3.5,我们使用Anaconda3配置使用。

    1.下载Anaconda3并打开Anaconda Navigator

        URL:https://www.continuum.io/downloads

        

    2.新建TensorFlow环境

       

    3.打开TensorFlow终端

       

      并输入以下命令  

    pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.1-cp35-cp35m-win_amd64.whl

      在PC联网的情况下下载依赖包,如下图最后会出现成功提示  

      

    4. 安装成功环境测试

       测试代码如下:(官网给的是单引号,需要改为双引号)

    python -c "import os; import inspect; import tensorflow; print(os.path.dirname(inspect.getfile(tensorflow)))"

      显示如下:

      

    5.案例测试

      输入Python在3.5.2的环境下做测试

      

      测试代码示例:  

    import tensorflow as tf
    >>> hello =tf.constant("Hello TensorFlow~")
    >>> soss=tf.Session()
    >>> print(soss.run(hello))
    b'Hello TensorFlow~'
    >>> a=tf.constant(10)
    >>> b=tf.constant(32)
    >>> print(soss.run(a+b))  #輸出42
  • 相关阅读:
    嵌入级联分类器
    AdaBoost 和 Real Adaboost 总结
    二分图匹配--匈牙利算法
    更新说明
    使用Visual Studio 2015 Community 开发windows服务
    C#字符串的不变性
    Windows 7 IIS HTTP 错误 500.21 – Internal Server Error 解决方法
    asp.net的请求管道事件
    Http请求过程
    css简单学习属性2---背景图片
  • 原文地址:https://www.cnblogs.com/jackchen-Net/p/6681269.html
Copyright © 2011-2022 走看看