下载*.whl文件方法安装:
方法:
在线安装:
方法:
在终端上简单测试:
python
import tensorflow as tfhello = tf.constant('Hello, TensorFlow!')sess = tf.Session()sess.run(hello)# 输出:'Hello, TensorFlow!'a = tf.constant(10)b = tf.constant(32)sess.run(a + b)# 输出:42sess.close()
Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
测试时出现上面警告时,想解决需要重新编译TensorFlow源码,也可用下面代码隐藏:
import osos.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
参考: