CPU指令未使用TensorFlow编译

Fiz*_*ics 6 python terminal cpu machine-learning tensorflow

MacBook Air:OSX El Capitan

当我在terminal(python 3 tfpractice.py)中运行TensorFlow代码时,我得到一个比正常更长的等待时间来返回输出,然后是这些错误消息:

W 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. 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. 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. 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. 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.

我不知道如何解决这个问题.我想让TensorFlow在这个pip3安装上工作.所以我沿着这条道路前进:tensorflow/core/platform/cpu_feature_guard

我需要在这里编辑代码吗?或者是否有另一种方法可以让TensorFlow使用这些指令进行编译?

我用TensorFlow安装了sudo pip3 install tensorflow.

Ujj*_*wal 9

注意:这些不是错误消息,而仅仅是警告消息.

最大化TF性能的最佳方法(除了编写好的代码!!),是从代码编译它

当你这样做时,TF会要求你提供各种选项,这些选项也包括这些指令的选项.

根据我自己的经验,从源代码编译平均性能更好.

如果您正在进行一些可以在GPU上完成的密集处理,那么这也可以解释您的等待时间.要获得GPU支持,您需要这样做pip3 install tensorflow-gpu