Python 使用SSE说明和pip安装Tensorflow

Python 使用SSE说明和pip安装Tensorflow,python,tensorflow,pip,virtualenv,sse,Python,Tensorflow,Pip,Virtualenv,Sse,我使用提供的默认指令在ubuntu 16.04上成功安装了仅cpu的tensorflow。说明建议使用virtualenv和pip,因此我没有从源代码构建。按照这些说明进行安装时,我没有遇到任何问题 我使用同一页上提供的说明验证了我的安装,当程序成功运行时,它会输出以下警告 W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructi

我使用提供的默认指令在ubuntu 16.04上成功安装了仅cpu的tensorflow。说明建议使用virtualenv和pip,因此我没有从源代码构建。按照这些说明进行安装时,我没有遇到任何问题

我使用同一页上提供的说明验证了我的安装,当程序成功运行时,它会输出以下警告

W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
Hello, TensorFlow!
我看到的所有stackoverflow页面只针对使用bazel从源代码构建的用户,但似乎不适用于使用pip的用户


如何根据SSE说明重新编译或更新安装?

您必须使用
bazel
--config=opt
选项来构建一个为您的体系结构定制的控制盘,然后使用
pip
安装生成的控制盘

我计划偶尔将2014年MacBook+Xeon V3优化版本上传到

安装Bazel后,为
pip
命令制作一个控制盘大致如下

./configure

export LD_LIBRARY_PATH="/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:$LD_LIBRARY_PATH"
export flags="--config=opt --config=cuda -k"

bazel build $flags -k //tensorflow/tools/pip_package:build_pip_package
bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
然后将车轮放入
/tmp/tensorflow\u包装中

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

如果以上解决了您的问题,请投票支持Christian Frei的回答,这些只是警告。根据此,在导入TensorFlow之前添加此行

import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import tensorflow as tf
我也有同样的问题,但建议的链接解决了我的问题


再看看这个,它将有助于了解更多关于SSE信息以及不同类型的日志指示器。

可能是您遇到了一些混合环境问题,过去我确实使用源代码在ubuntu 16.04上安装tensorflow,但由于v.0.11 simple pip安装工作正常,我已经编译了tensorflow以使用SSE指令。你可以从下载预编译的二进制文件。嗯,你介意告诉我在安装的哪一步我应该这样做吗?我只是按照tensorflow教程中有关virtualenv的说明进行了操作,不知道我应该在哪里执行此配置步骤您需要按照从源代码构建的说明进行操作我不太愿意处理从源代码构建可能带来的任何问题。。现在我将把它作为一个问题放到tensorflow github上,并处理警告编辑:按enter键需要新段落