Tensorflow编译加速CPU

因为我在
python 2.7中导入tensorflow后使用以下命令:

sess = tf.Session()

警告/错误:

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-02-02 00:41:48.616602: 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-02-02 00:41:48.616614: 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-02-02 00:41:48.616624: 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,它可以在你的机器上运行得更快.没有修复,因为这不是问题,而是旨在向用户提供此信息的行为.

默认情况下,这些CPU指令未启用,以提供与大多数计算机更广泛的兼容性.

正如文档所说:

TensorFlow checks on startup whether it has been compiled with the optimizations available on the CPU. If the optimizations are not included, TensorFlow will emit warnings, e.g. AVX, AVX2, and FMA instructions not included.

有关详细信息,请参阅Performance Guide.

点赞