首页 文章

TensorFlow似乎没有安装

提问于
浏览
0

我有这些警告:

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 进程中 .

任何的想法? :/ 预先感谢 !

1 回答

  • 0

    您可以像这样屏蔽这些警告:

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

    请注意,您的程序仍然输出'Hello,TensorFlow!',只是在所有关于SSE4.2的警告之后 .

相关问题