TensorFlow似乎没有安装
问题描述:
我有这些警告: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
进程。
有什么想法? :/ 预先感谢 !
答
可以掩盖这些警告像这样:
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
注意,你的程序仍输出,只是简单地后所有关于SSE4.2警告的“你好,TensorFlow!”。
通过这样做,你只会隐藏不回答我的问题的日志,不是吗?感谢您的帮助 ! – Emixam23