[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

相關文章
相關標籤/搜索