[TensorFlow]TensorFlow安装方法

下载*.whl文件方法安装:

方法:http://www.python36.com/install-tensorflow-using-official-pip-pacakage/

在线安装:

方法:https://blog.csdn.net/y1250056491/article/details/78670710

在终端上简单测试:

python
import tensorflow as tf

hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
sess.run(hello)
# 输出:'Hello, TensorFlow!'

a = tf.constant(10)
b = tf.constant(32)
sess.run(a + b)
# 输出:42

sess.close()

Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA

测试时出现上面警告时,想解决需要重新编译TensorFlow源码,也可用下面代码隐藏:

import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'

参考:https://bbs.csdn.net/topics/392284025

猜你喜欢

转载自www.cnblogs.com/hcbin/p/9192955.html