2016-10-14 4 views
9

Я пробовал pip install tensorflow на OS X El Capitan, и это удалось. Однако, если я попытался импортировать shadoworflow, возникла ошибка ImportError. Скажите, пожалуйста, когда вы это знаете.Требуется тензорный поток с Python 2.7.11. ImportError

>>> import tensorflow 
Traceback (most recent call last): 
File "<stdin>", line 1, in <module> 
File "/usr/local/lib/python2.7/site-packages/tensorflow/__init__.py", line 23, in <module> 
from tensorflow.python import * 
File "/usr/local/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 49, in <module> 
from tensorflow.python import pywrap_tensorflow 
File "/usr/local/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in <module> 
_pywrap_tensorflow = swig_import_helper() 
File "/usr/local/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: dlopen(/usr/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow.so, 10): no suitable image found. Did find: 
/usr/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow.so: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x03 
>>> 

ответ

10

я получил тот же самый вопрос. Попробуйте следовать [официальный инструкция] установить tensorflow: https://www.tensorflow.org/versions/r0.11/get_started/os_setup.html#pip-installation

# Mac OS X 
$ sudo easy_install pip 
$ sudo easy_install --upgrade six 

Затем выберите правильный двоичный файл для установки:

# Ubuntu/Linux 64-bit, CPU only, Python 2.7 
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.11.0rc0-cp27-none-linux_x86_64.whl 

# Ubuntu/Linux 64-bit, GPU enabled, Python 2.7 
# Requires CUDA toolkit 7.5 and CuDNN v5. For other versions, see "Install from sources" below. 
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.11.0rc0-cp27-none-linux_x86_64.whl 

# Mac OS X, CPU only, Python 2.7: 
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.11.0rc0-py2-none-any.whl 

# Mac OS X, GPU enabled, Python 2.7: 
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/gpu/tensorflow-0.11.0rc0-py2-none-any.whl 

# Ubuntu/Linux 64-bit, CPU only, Python 3.4 
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.11.0rc0-cp34-cp34m-linux_x86_64.whl 

# Ubuntu/Linux 64-bit, GPU enabled, Python 3.4 
# Requires CUDA toolkit 7.5 and CuDNN v5. For other versions, see "Install from sources" below. 
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.11.0rc0-cp34-cp34m-linux_x86_64.whl 

# Ubuntu/Linux 64-bit, CPU only, Python 3.5 
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.11.0rc0-cp35-cp35m-linux_x86_64.whl 

# Ubuntu/Linux 64-bit, GPU enabled, Python 3.5 
# Requires CUDA toolkit 7.5 and CuDNN v5. For other versions, see "Install from sources" below. 
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.11.0rc0-cp35-cp35m-linux_x86_64.whl 

# Mac OS X, CPU only, Python 3.4 or 3.5: 
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.11.0rc0-py3-none-any.whl 

# Mac OS X, GPU enabled, Python 3.4 or 3.5: 
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/gpu/tensorflow-0.11.0rc0-py3-none-any.whl 

Установка TensorFlow:

# Python 2 
$ sudo pip install --upgrade $TF_BINARY_URL 

# Python 3 
$ sudo pip3 install --upgrade $TF_BINARY_URL 
+0

Спасибо тааак много ! Оно работает! –

+0

yep, works. удивительно. потратил бы неделю на то, чтобы исправить это. – Wapiti

Смежные вопросы