如何在不从源代码安装张量流的情况下使用 SSE4.1 指令?



我尝试根据其官方网站上的指南从源代码安装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.

我想知道是否有办法"使用 SSE4.1 指令"和上面提到的其他指令,而无需从源代码安装 Tensorflow。

谢谢!

如果不从源代码构建 TensorFlow,就无法使用 SIMD 指令。

默认情况下,TensorFlow 二进制文件没有进行此优化,以尽可能提高与更广泛 CPU 架构的兼容性。

如果要使警告静音,可以将TF_CPP_MIN_LOG_LEVEL设置为 2:

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

此 TF 环境变量默认为0,显示所有日志。 将其设置为1将过滤掉INFO日志,2还将使日志WARNING静音。

相关内容

最新更新