美文网首页
TensorFlow

TensorFlow

作者: Jackpot_0213 | 来源:发表于2018-02-02 03:10 被阅读0次

    一个 Google 开源的深度学习框架,应用在真实的数据集中

    安装

    跟往常一样,我们用 Conda 来安装 TensorFlow。你也许已经有了一个 TensorFlow 环境,但要确保你安装了所有必要的包。

    OS X 或 Linux

    运行下列命令来配置开发环境

    conda create -n tensorflow python=3.5
    source activate tensorflow
    conda install pandas matplotlib jupyter notebook scipy scikit-learn
    conda install -c conda-forge tensorflow
    

    Windows

    Windows系统,在你的 console 或者 Anaconda shell 界面,运行

    conda create -n tensorflow python=3.5
    activate tensorflow
    conda install pandas matplotlib jupyter notebook scipy scikit-learn
    conda install -c conda-forge tensorflow
    

    Hello, world!

    在 Python console 下运行下列代码,检测 TensorFlow 是否正确安装。如果安装正确,Console 会打印出 "Hello, world!"。现在还不需要理解这段代码做了什么,你会在下一节学到。

    import tensorflow as tf
    
    # Create TensorFlow object called tensor
    hello_constant = tf.constant('Hello World!')
    
    with tf.Session() as sess:
        # Run the tf.constant operation in the session
        output = sess.run(hello_constant)
        print(output)
    

    相关文章

      网友评论

          本文标题:TensorFlow

          本文链接:https://www.haomeiwen.com/subject/etuczxtx.html