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

时间:2017-04-02 19:35:22

标签: python terminal tensorflow cpu sse

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

INFO [PO-thread-0] 2017-04-02 19:26:43,176 DbInfoRollupPlugin.java:196 - Error retrieving node level db summary java.util.concurrent.TimeoutException: null at java.util.concurrent.FutureTask.get(FutureTask.java:205) [na:1.8.0_112] at com.datastax.bdp.plugin.DeferringScheduler$DeferringTask.get(DeferringScheduler.java:115) ~[dse-core-5.0.5.jar:5.0.5] at com.datastax.bdp.reporting.snapshots.db.DbInfoRollupPlugin$DbInfoRollupTask.doRollup(DbInfoRollupPlugin.java:192) [dse-core-5.0.5.jar:5.0.5] at com.datastax.bdp.reporting.snapshots.db.DbInfoRollupPlugin$DbInfoRollupTask.run(DbInfoRollupPlugin.java:173) [dse-core-5.0.5.jar:5.0.5] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_112] at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [na:1.8.0_112] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_112] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [na:1.8.0_112] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_112] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_112] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_112]

所以我试图从源代码安装Tensorflow,以便可以使用Tensorflow编译这些指令。

  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.?)

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

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

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

    OS Sierra(10.12.2)

2 个答案:

答案 0 :(得分:1)

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

步骤操作即可

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

祝你好运。

答案 1 :(得分:0)

在OSX上你可以做到

brew install tensor-flow

我相信。