首页 文章

从哪里添加CPU指令从源安装Tensorflow?

提问于
浏览
0

我正在尝试从源安装Tensorflow,因为当我使用pip和virtualenv安装时没有安装CPU指令(SSE,AVX ......)的警告:

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,以便可以使用Tensorflow编译这些指令 .

  • 除了Tensorflow网站上的说明外,我是否需要做任何事情来编译这些说明? ( ./configure ?)

  • 如果是这样,我需要做什么以及我该如何做?

  • 在我必须安装pip包时的安装中,Tensorflow网站说对于Linux,命令是: sudo pip install /tmp/tensorflow_pkg/tensorflow-1.0.1-py2-none-any.whl 它说这个命令会因机器而异,MacOS的等效命令是什么?我如何进行Bazel wheel 步骤?

旁注:我被告知有几种方法可以用Bazel做到这一点,但由于对Bazel缺乏经验而在终端上没有太多经验,我需要明确的步骤做什么?

OS Sierra(10.12.2)

2 回答

  • 0

    对于您的第一个问题(和第二个问题), . / configure的默认设置将为您提供针对您的机器优化的指令集 . 这是通过默认编译器选项 -march=native 完成的 . 只需按照步骤here

    对于第三个,一旦在 /tmp/tensorflow_pkg (或其中任何地方)生成了 whl 文件,请查看该目录中文件的名称 . 它将与指令中给出的linux示例类似但不同 . 然后,您应该能够使用 pip install /tmp/tensorflow_pkg/YOUR_FILENAME.whl 安装它 . 如果您有任何问题,可以按照步骤here但使用 /tmp/tensorflow_pkg/YOUR_FILENAME.whl 代替 tensorflowtensorflow-gpu

    祝好运 .

  • 1

    在OSX上你可以做到

    brew install tensor-flow
    

    我相信 .

相关问题