无效的ELF标头张量流

Sta*_*ess 2 python anaconda tensorflow

我首先尝试通过以下方式安装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
Run Code Online (Sandbox Code Playgroud)

然后我试图使用从溶液中(对于Linux和tensorflow 0.9.0稍作修改的版本)iRapha这里:

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
Run Code Online (Sandbox Code Playgroud)

然后我尝试测试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
Run Code Online (Sandbox Code Playgroud)

我在这里查了一下.基于这个答案,我试过:

user@WS1:~July 2016$ pip install tensorflow
Run Code Online (Sandbox Code Playgroud)

一切都说成功安装了tensorflow,但是当我在python中导入它时,我得到了无效的ELF头错误.有谁知道如何解决这个问题?

Zee*_*Zee 5

如果您安装了与您的平台不匹配的tensorflow软件包,则可能会发生这种情况.

一个极端的例子是在linux上安装mac平台包(如下所示).

export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.10.0rc0-cp35-cp35m-linux_x86_64.whl
Run Code Online (Sandbox Code Playgroud)

只需确保使用正确的平台.