美文网首页
Tensorflow安装

Tensorflow安装

作者: _Haimei | 来源:发表于2018-07-31 14:38 被阅读19次

    安装

    pip install tensorflow
    

    在终端测试

    In [1]: import tensorflow as tf
    
    In [2]: hello = tf.constant("Hello,TensorFlow!")
    
    In [3]: sess = tf.Session()
    2018-07-31 15:20:37.669558: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
    
    In [4]: sess.run(hello)
    Out[4]: b'Hello,TensorFlow!'
    
    In [5]: a = tf.constant(10)
    
    In [6]: b = tf.constant(32)
    
    In [7]: sess.run(a+b)
    Out[7]: 42
    

    相关文章

      网友评论

          本文标题:Tensorflow安装

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