[TensorFlow]TensorFlow安装方法

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

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

 

在线安装:this

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

 

在终端上简单测试:code

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 FMAblog

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

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

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

相关文章
相关标签/搜索