TensorFlow库未编译为使用AVX-AVX2
问题描述:
我是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是什么,所以我需要一步一步的指示。
非常感谢!
[TensorFlow未被编译为使用SSE(等)指令的可能重复,但这些指令可用](https://*.com/questions/43134753/tensorflow-wasnt-compiled-to-use-sse -etc-instructions-but-these-are-availab) – GPhilo
我不想隐藏警告,我想使用AVX-AVX2指令,但不知道如何 –
从答案到链接问题:“启用这些操作是一个编译时操作(即使用SSE,需要从源代码构建库,以启用特定的SSE版本),在这种情况下,您可以[查看此问题](https: //*.com/questions/41293077/how-to-compile-tensorflow-with-sse4-2-and-avx-instructions)。” – GPhilo