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
  • 相关阅读:
    在ASP.NET Core中使用TagHelpers
    ASP.NET Core使用Redis
    ASP.NET Core MVC中视图
    HTTP状态码
    ASP.NET Core中静态文件
    ASP.NET Core中使用依赖注入
    在ASP.NET Core中使用多个环境
    ASP.NET Core读取配置文件
    HTML+CSS解决高度塌陷和垂直重叠
    Element-UI的表格合计行的列添加操作按钮
  • 原文地址:https://www.cnblogs.com/jackchen-Net/p/6681269.html
Copyright © 2011-2022 走看看