2017-09-26 198 views
0

我有這些警告:TensorFlow似乎沒有安裝

2017年9月26日14:50:45.956966:W tensorflow /核心/平臺/ cpu_feature_guard.cc:45] TensorFlow庫WASN」編譯爲使用SSE4.2指令,但這些指令可在您的機器上使用,並可加速CPU計算。 TensorFlow庫未編譯爲使用AVX指令,但這些指令可在您的機器上使用,並且可以加速CPU計算。 TensorFlow庫沒有被編譯爲使用AVX2指令,但是這些指令在您的機器上可用,並且可以加速CPU計算。

2017-09-26 14:50:45.956996:W tensorflow/core/platform/cpu_feature_guard.cc:45] TensorFlow庫未編譯爲使用FMA指令,但這些指令可在您的機器上使用, CPU計算。

因此,基於我的互聯網上找到,然後我跟着這個鏈接:

https://www.tensorflow.org/install/install_sources

然而,當我嘗試:

$ python 

和:

# Python 
import tensorflow as tf 
hello = tf.constant('Hello, TensorFlow!') 
sess = tf.Session() 
print(sess.run(hello)) 

輸出應該是:Hello, TensorFlow!

不過,我不明白,在所有...

[email protected]:~/Workspace$ python 
Python 3.6.2 (default, Sep 4 2017, 16:58:35) 
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)] on darwin 
Type "help", "copyright", "credits" or "license" for more information. 

>>> import tensorflow as tf 
>>> hello = tf.constant('Hello, TensorFlow!') 
>>> sess = tf.Session() 
2017-09-26 14:56:33.905065: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations. 
2017-09-26 14:56:33.905096: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations. 
2017-09-26 14:56:33.905105: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations. 
2017-09-26 14:56:33.905112: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations. 
>>> print(sess.run(hello)) 
b'Hello, TensorFlow!' 
>>> 

我即使在安裝了它,我仍然有警告,爲何如此?我使用Xcode 7.3,並沒有將GPU放入./configuration進程。

有什麼想法? :/ 預先感謝 !

回答

0

可以掩蓋這些警告像這樣:

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

注意,你的程序仍輸出,只是簡單地後所有關於SSE4.2警告的「你好,TensorFlow!」。

+0

通過這樣做,你只會隱藏不回答我的問題的日誌,不是嗎?感謝您的幫助 ! – Emixam23