TensorFlow 未编译为使用 SSE(等)指令,但这些指令可用

新手上路,请多包涵

我第一次使用一些示例代码运行 TensorFlow。运行我的代码时,我收到以下警告。有谁知道为什么会这样,以及如何解决?

 2017-03-31 02:12:59.346109: W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE instructions, but these are available on your machine and could speed up CPU computations.
2017-03-31 02:12:59.346968: W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE2 instructions, but these are available on your machine and could speed up CPU computations.
2017-03-31 02:12:59.346975: W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow libbrary wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations.
2017-03-31 02:12:59.346979: W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2017-03-31 02:12:59.346983: W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\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-03-31 02:12:59.346987: W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\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-03-31 02:12:59.346991: W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\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-03-31 02:12:59.346995: W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\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.

原文由 Jsleshem 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 941
2 个回答

这些是警告(如冒号后的 W 所示。错误有 E )。

警告是指您的 CPU 支持 SSE Instructions 的事实,它允许一些快速的硬件内并行操作。启用这些操作是一个编译时操作(即要使用 SSE,您需要从源代码构建库,以启用您所针对的特定 SSE 版本),在这种情况下,您可以 查看此问题

但是请注意,SSE 支持仅影响计算速度。 Tensorflow 可以使用或不使用 SSE,但您的代码可能需要更长时间才能运行。另请注意,这仅影响 CPU。如果您使用的是 Tensorflow 的 GPU 版本,则在 GPU 上运行的所有操作都不会受益于 SSE 指令。

原文由 GPhilo 发布,翻译遵循 CC BY-SA 4.0 许可协议

要隐藏这些警告,您可以在实际代码之前执行此操作。

 import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import tensorflow as tf

详细讨论请参考这里 https://github.com/tensorflow/tensorflow/issues/7778

我希望,它可以为对方提供帮助。 :)

原文由 nanangarsyad 发布,翻译遵循 CC BY-SA 3.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题