安装
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
网友评论