之前我已经在Ubuntu 16.04上为Python 2.7安装了来自source的tensorflow,它运行良好。
对于Python 3.5(我创建了一个新的anaconda环境),我安装了一个二进制版本,但是我收到了警告信息..
编辑,使用下载的二进制轮,我得到的消息是......
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.
W 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.
W 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.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:910] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
...并且代码似乎运行速度明显慢于使用我的本机编译的py27运行。
所以,我卸载了“旧的”tensorflow二进制文件(对于py35),并通过the Tensorflow Install from Sources page的说明,安装了所有软件包,运行./configure,将其指向正确版本的python( 〜/ anaconda2 / envs / py35 / bin / python及其相应的库路径),选择了我的CUDA选项,一直到最后都没有错误构建...
在最后一步,它告诉我“这个平台上没有支持的轮子” - 你的意思是我刚建立的平台?
$ ./configure
...
$ bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package
...
$ bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
Thu Mar 9 23:17:35 CST 2017 : === Using tmpdir: /tmp/tmp.RrsUxPKxFg
~/tmp/tensorflow/bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles ~/tmp/tensorflow
~/tmp/tensorflow
/tmp/tmp.RrsUxPKxFg ~/tmp/tensorflow
Thu Mar 9 23:17:36 CST 2017 : === Building wheel
~/tmp/tensorflow
Thu Mar 9 23:17:45 CST 2017 : === Output wheel file is in: /tmp/tensorflow_pkg
$ sudo -H pip install /tmp/tensorflow_pkg/tensorflow-1.0.1-cp35-cp35m-linux_x86_64.whl
tensorflow-1.0.1-cp35-cp35m-linux_x86_64.whl is not a supported wheel on this platform.
以下是一些检查......
$ python --version
Python 3.5.3 :: Continuum Analytics, Inc.
$ which python
/home/myusername/anaconda2/envs/py35/bin/python
$ which pip
/home/myusername/anaconda2/envs/py35/bin/pip
$ pip install --upgrade pip
Requirement already up-to-date: pip in /home/myusername/anaconda2/envs/py35/lib/python3.5/site-packages
$
有人可以提出建议吗?
我已经看过关于问题的各种帖子了。 “不支持的轮子”,人们正在使用与正确版本的python不匹配的下载二进制轮(例如cp34 vs cp35),以及关于在Windows上从源安装的帖子,但没有看过像我这样的帖子:涉及安装来源,在Linux上更正Python的“匹配”版本。检查了Github问题的张力流,也没有看到这个。
答案 0 :(得分:4)
运行git push --force
安装已编译的PIP包导致此错误。 Anaconda使用虚拟环境,该环境覆盖sudo -H pip install ...
可执行文件的路径。但是,pip
命令does not preserve the user's $PATH
environment variable,sudo
将使用系统安装的sudo -H pip install ...
,在这种情况下,它对应于不同版本的Python。
幸运的是,如果您使用的是Anaconda,则无需使用pip
来运行sudo
,因为整个环境都存储在您的用户拥有的目录中。