我首先尝试通过以下方式安装tensorflow:
user@WS1:~/July 2016$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl
user@WS1:~/July 2016$ pip install --upgrade $TF_BINARY_URL
然后我尝试使用了一个来自iRapha的解决方案(稍作修改以适应Linux和tensorflow 0.9.0):
user@WS1:~/July 2016$ wget https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl
user@WS1:~/July 2016$ pip install tensorflow-0.9.0-cp27-none-linux_x86_64.whl
接下来我尝试测试tensorflow是否已经成功安装。以下输出显示出现了“无效的ELF头”错误。
user@WS1:~/July 2016$ python
Python 2.7.12 |Anaconda 2.5.0 (64-bit)| (default, Jul 2 2016, 17:42:40)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
>>> import tensorflow
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/export/mlrg/caugusta/anaconda2/lib/python2.7/site-packages /tensorflow/__init__.py", line 23, in <module>
from tensorflow.python import *
File "/export/mlrg/caugusta/anaconda2/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 48, in <module>
from tensorflow.python import pywrap_tensorflow
File "/export/mlrg/caugusta/anaconda2/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
_pywrap_tensorflow = swig_import_helper()
File "/export/mlrg/caugusta/anaconda2/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
ImportError: /export/mlrg/caugusta/anaconda2/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow.so: invalid ELF header
我在这里查看了相关信息,根据那个回答,我尝试了以下操作:
user@WS1:~July 2016$ pip install tensorflow
所有指标均表明TensorFlow已经成功安装,但在Python中导入时出现了“invalid ELF header”错误。 有人知道我如何解决这个问题吗?
pip
安装吗?我用pip search tensorflow
找不到它。 - Brandon H. Gomes