我有这些警告:
2017-09-26 14:50:45.956966:W tensorflow / core / platform / cpu_feature_guard.cc:45] TensorFlow库未编译为使用SSE4.2指令,但这些指令可在您的计算机上使用,并且可以加速CPU计算。
2017-09-26 14:50:45.956986:W tensorflow / core / platform / cpu_feature_guard.cc:45] TensorFlow库未编译为使用AVX指令,但这些可在您的计算机上使用并且可以加速CPU计算。
2017-09-26 14:50:45.956990:W tensorflow / core / platform / cpu_feature_guard.cc:45] 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!
但是,我根本不明白......
emixam23@pt-mguittet:~/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 :(得分:0)
您可以屏蔽这些警告:
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
请注意,您的程序仍会输出' Hello,TensorFlow!',只是在关于SSE4.2的所有警告之后。
答案 1 :(得分:0)
您为什么说它似乎没有安装?
您正在获得预期的结果(您好,Tensorflow!),但您也收到了这些警告。关于警告,在这里进行了讨论:Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2
关于Hello Tensorflow!之前的“ b”,请参见What does the 'b' character do in front of a string literal?。
希望有帮助。