无法解决tensorflow给出的警告

时间:2017-06-04 16:34:20

标签: tensorflow

每当我使用Tensor Flow运行任何脚本时,我都会收到以下警告:

The TensorFlow library wasn't compiled to use SSE instructions, but 
these are available on your machine and could speed up CPU 
computations

我尝试按照this stack overflow post上发布的方法操作,并在命令行中输入以下命令:

bazel build -c opt --copt=-mavx --copt=-mavx2 --copt=-mfma --copt=-mfpmath=both --copt=-msse4.2 --config=cuda -k //tensorflow/tools/pip_package:build_pip_package

但是我收到以下错误

The 'build' command is only supported from within a workspace.

如何解决此错误,然后使用SSE指令编译张量流

1 个答案:

答案 0 :(得分:0)

Installing Tensorflow from Sources页面很好地解释了该过程,确保在运行构建步骤之前满足所有要求。

如果您希望自动执行./configure(tensorflow-cpu)步骤,可以从TF的根目录运行以下命令:

# CPU default configuration
tensorflow/tools/ci_build/builds/configured CPU

然后使用原生优化运行build命令:

# build with native optimization
bazel build -c opt --copt=-march=native tensorflow/tools/pip_package:build_pip_package