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

Jsl*_*hem 36 python python-3.x tensorflow

我是第一次运行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.
Run Code Online (Sandbox Code Playgroud)

GPh*_*ilo 53

这些是警告,而不是错误(如W冒号后面所示.错误有错误E).

警告指的是您的CPU支持SSE指令,这允许一些快速的硬件并行操作.启用这些操作是一个编译时操作(即,使用SSE,您需要从源构建库,启用您所针对的特定SSE版本),在这种情况下,您可能会看一下这个问题.

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


nan*_*yad 15

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

import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import tensorflow as tf
Run Code Online (Sandbox Code Playgroud)

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

我希望,它可以帮助对方.:)

  • 基本上它是使用python在你的系统上设置环境变量而不是手动设置它.例如,在cmd上(如果你是windows用户)这样做`set TF_CPP_MIN_LOG_LEVEL = 2`就行了.关键是,如果你想隐藏警告,你可以这样做.**这里有关于该env变量的更详细说明:**TF_CPP_MIN_LOG_LEVEL是一个TensorFlow环境变量,负责日志,将INFO日志设置为1,过滤掉警告2并另外静音ERROR日志(不推荐)设置它希望它能为你提供帮助:) (2认同)