2017-06-04 86 views
1

被赋予每当我运行使用张量流中的任何脚本,我得到以下警告:无法解决的警告通过tensorflow

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指令编译张量流程

回答

0

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

如果你想自动化你可以从TF的根目录中运行以下命令./configure(tensorflow-CPU)步骤:

# 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 
+0

我使用了https://www.tensorflow.org/install/install_linux并通过pip进行安装 – rjmessibarca

+0

pip软件包中的编译二进制文件不包含特定于设备的优化。为了让你需要从源代码编译,如我在答案中的链接所述。 – sirfz

+0

我需要先卸载tensorflow吗?如果是这样如何? – rjmessibarca