2017-06-04 51 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