TensorFlow尚未编译为使用SSE(etc.)指令,但是这些可用
python
python-3.x
tensorflow
5
0

我是第一次运行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.
参考资料:
Stack Overflow
收藏
评论
共 3 个回答
高赞 时间 活跃

这不是错误,只是警告说,如果您从源代码构建TensorFlow,则在您的计算机上可以更快。

就像警告说的那样,仅在需要使TF更快时才应使用这些标志编译TF。

您可以使用TF环境变量TF_CPP_MIN_LOG_LEVEL ,它的工作方式如下:

  • 默认为0,显示所有日志
  • 要过滤掉INFO日志,请将其设置为1
  • WARNINGS另外2
  • 并进一步过滤掉ERROR日志,将其设置为3

因此,您可以执行以下操作使警告静音:

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

有关更多详细讨论,请参见如何使用SSE4.1,SSE4.2和AVX编译张量流。

收藏
评论

这些是警告,而不是错误(如冒号后的W表示。错误在那里带有E )。

警告是指您的CPU支持SSE指令 ,从而可以进行一些快速的硬件内并行操作。启用这些操作是一个编译时操作(即,要使用SSE,您需要从源代码构建库以启用要定位的特定SSE版本),在这种情况下,您可以考虑一下此问题

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

收藏
评论

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

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

有关详细讨论,请参阅此处https://github.com/tensorflow/tensorflow/issues/7778

希望对其他人有帮助。 :)

收藏
评论
新手导航
  • 社区规范
  • 提出问题
  • 进行投票
  • 个人资料
  • 优化问题
  • 回答问题

关于我们

常见问题

内容许可

联系我们

@2020 AskGo
京ICP备20001863号