2017-06-23 111 views
0

進口tensorflow當從我的覆盆子PI的源代碼安裝tensorflow後,進口tensorflow給了我以下錯誤:錯誤樹莓PI 2

import tensorflow 
Traceback (most recent call last): 
    File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 41, in <module> 
    from tensorflow.python.pywrap_tensorflow_internal import * 
    File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module> 
    _pywrap_tensorflow_internal = swig_import_helper() 
    File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper 
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) 
    File "/usr/lib/python3.4/imp.py", line 243, in load_module 
    return load_dynamic(name, filename, file) 
ImportError: /usr/local/lib/python3.4/dist-packages/tensorflow/python/_pywrap_tensorflow_internal.so: wrong ELF class: ELFCLASS64 

During handling of the above exception, another exception occurred: 

Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
    File "/usr/local/lib/python3.4/dist-packages/tensorflow/__init__.py", line 24, in <module> 
    from tensorflow.python import * 
    File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/__init__.py", line 49, in <module> 
    from tensorflow.python import pywrap_tensorflow 
    File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 52, in <module> 
    raise ImportError(msg) 
ImportError: Traceback (most recent call last): 
    File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 41, in <module> 
    from tensorflow.python.pywrap_tensorflow_internal import * 
    File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module> 
    _pywrap_tensorflow_internal = swig_import_helper() 
    File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper 
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) 
    File "/usr/lib/python3.4/imp.py", line 243, in load_module 
    return load_dynamic(name, filename, file) 
ImportError: /usr/local/lib/python3.4/dist-packages/tensorflow/python/_pywrap_tensorflow_internal.so: wrong ELF class: ELFCLASS64 

順便說一句,我從官方tensorflow網站上安裝Python 3.4上的覆盆子pi 2。 我卸載了包括numpy在內的所有tensorflow依賴關係,並進行了安裝。這安裝了所有的依賴關係,但花了大約一個小時。它還說:

Could not find .egg-info directory in install record for numpy>=1.11.0 (from tensorflow==1.2.0) 

和:

Could not find .egg-info directory in install record for protobuf 

然後導入tensorflow時,它給我的第一個錯誤。

回答

0

您錯誤_pywrap_tensorflow_internal.so: wrong ELF class: ELFCLASS64意味着您正嘗試將64位代碼加載到32位進程中。
你有什麼操作系統? guy已成功安裝Raspberry Pi 2上的tensorflow。 您也可以嘗試this package
請注意,運行Raspberry 2不是簡單的任務。你使用了什麼官方tensorflow網站?
至於egg-info警告,請嘗試使用pip install --upgrade setuptools pip升級setuptools。