2017-10-18 105 views
2

我是Tensorflow的新手。 我正在使用64位版本的Windows 10,我想爲CPU安裝Tensorflow。 我不記得,我也跟着安裝的具體步驟,但是當我使用檢查安裝:TensorFlow庫未編譯爲使用AVX-AVX2

import tensorflow as tf 
hello = tf.constant('Hello, TensorFlow!') 
sess = tf.Session() 
print(sess.run(hello)) 

我有以下的輸出:

2017-10-18 09:56:21.656601: W C:\tf_jenkins\home\workspace\rel-win\M\windows\PY\36\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. 
2017-10-18 09:56:21.656984: W C:\tf_jenkins\home\workspace\rel-win\M\windows\PY\36\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. 
b'Hello, TensorFlow!' 

我運行在蟒蛇崇高的文本3使用包SublimeREPL。 我試圖搜索這些錯誤,發現它意味着tensorflow沒有這些指令,可以提高CPU的性能。我還發現了隱藏這些警告的代碼,但實際上我想使用這些說明。

,我發現,使這是代碼:

bazel build -c opt --copt=-mavx --copt=-mavx2 --copt=-msse4.2 --copt=-msse4.1 --copt=-msse3 --copt=-mfma -k //tensorflow/tools/pip_package:build_pip_package 

但我得到這樣的輸出:

ERROR: Skipping '//tensorflow/tools/pip_package:build_pip_package': no such package 'tensorflow/tools/pip_package': BUILD file not found on package path. 
WARNING: Target pattern parsing failed. Continuing anyway. 
INFO: Found 0 targets... 
ERROR: command succeeded, but there were errors parsing the target pattern. 
INFO: Elapsed time: 8,147s, Critical Path: 0,02s 

我怎樣才能解決這個問題? 最後,我不明白pip,wheel和bazel是什麼,所以我需要一步一步的指示。

非常感謝!

+1

[TensorFlow未被編譯爲使用SSE(等)指令的可能重複,但這些指令可用](https://stackoverflow.com/questions/43134753/tensorflow-wasnt-compiled-to-use-sse -etc-instructions-but-these-are-availab) – GPhilo

+0

我不想隱藏警告,我想使用AVX-AVX2指令,但不知道如何 –

+0

從答案到鏈接問題:「啓用這些操作是一個編譯時操作(即使用SSE,需要從源代碼構建庫,以啓用特定的SSE版本),在這種情況下,您可以[查看此問題](https: //stackoverflow.com/questions/41293077/how-to-compile-tensorflow-with-sse4-2-and-avx-instructions)。」 – GPhilo

回答

0

如果要下載TensorFlow源碼,請使用編譯+安裝,使用this鏈接。
如果你想下載二進制文件,然後使用this鏈接。