【问题标题】:The TensorFlow library wasn't compiled to use SSE4.1, SSE4.2, AVX, AVX2 instructions to speed up CPU computationsTensorFlow 库未编译为使用 SSE4.1、SSE4.2、AVX、AVX2 指令来加速 CPU 计算
【发布时间】:2020-07-23 04:45:33
【问题描述】:

我只有 Intel(R) Xeon(R) CPU E5-2640 v4 @ 2.40GHz 型号的 CPU 机器。我需要加快运行 tensorflow 代码的运行时间。在运行代码时,它会打印警告消息,例如:

    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.
    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.
    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.
    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.
    tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX512F instructions, but these are available on your machine and could speed up CPU computations.
    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.

我安装了我的 python 和 tensorflow,如下:

conda create -n  py27tf121 python=2.7
pip install tensorflow=1.2.1

我认为这个警告可以加快进程,但我不知道如何激活这些标志

【问题讨论】:

    标签: linux tensorflow time cpu


    【解决方案1】:

    此消息意味着,如果您从源代码编译 TensorFlow,您可能会获得更好的性能。话虽如此,从源代码编译需要时间和精力。如果您想尝试这样做,您可能会发现this 很有用

    【讨论】:

      猜你喜欢
      • 2017-07-31
      • 1970-01-01
      • 2018-03-30
      • 2017-05-08
      • 1970-01-01
      相关资源
      最近更新 更多