2017-04-02 50 views
0

我试图从源代码安装,因为,当我与PIP和安装virtualenv中未安装CPU指令(SSE,AVX ...)警告Tensorflow:在哪里添加CPU指令从源代码安装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,以便可以使用Tensorflow编译这些指令。

  1. 除了Tensorflow网站上的说明以外,我还需要做什么来编译这些指令吗? (./configure?)

  2. 如果是这样,我需要做什么以及如何做到这一点?

  3. 时,我必须安装PIP包安装,Tensorflow网站说,针对Linux的命令是: sudo pip install /tmp/tensorflow_pkg/tensorflow-1.0.1-py2-none-any.whl它说,该命令将根据机器上的不同,什么是MacOS的等效命令?我该如何去Bazel wheel步骤?

侧面说明:有人告诉我,有一些方法我可以巴泽勒做到这一点,但作为雏与巴泽尔并没有太多经验丰富的终端,我需要做什么明确的步骤是什么?

OS塞拉利昂(10.12.2)

+0

从已删除的答案:预先构建的优化二进制文件:https://github.com/lakshayg/tensorflow-build –

回答

0

在OSX你可以做

brew install tensor-flow 

我相信。

1

对于您的第一个问题(和两个),./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

好运。

相关问题