gpt4 book ai didi

python - 使用 Tensorflow 0.8.0 的 Odroid C2 设置困难

转载 作者:太空狗 更新时间:2023-10-29 11:21:38 26 4
gpt4 key购买 nike

我正在尝试在 Odroid C2 上安装 Tensorflow 0.8.0。 C2 使用 64 位 ARM 处理器并在 Ubuntu 16.04 上运行 Python 2.7 和 3.5,所以我希望事情会很简单,因为我相信这些是受支持的。以我极其贫乏的理解来看,不同的软件似乎存在很多混淆,不相信该板是 64 位的。

$ uname -i
aarch64
$ cat /proc/cpuinfo
Processor : AArch64 Processor rev 4 (aarch64)

按照位于 https://www.tensorflow.org/versions/r0.8/get_started/os_setup.html 的 tensorflow 网站上的安装说明进行操作

经过一轮apt-get更新,升级和安装依赖,然后下载Python 2.7 Linux 64bit版本的Anaconda:

$ bash Anaconda2-4.0.0-Linux-x86_64.sh
WARNING:
Your operating system appears not to be 64-bit, but you are trying to
install a 64-bit version of Anaconda2.
Are sure you want to continue the installation? [yes|no]

继续进行,安装最终崩溃

installing: conda-env-2.4.5-py27_0 ...
Anaconda2-4.0.0-Linux-x86_64.sh: line 461: /home/odroid/anaconda2/pkgs/python-2.7.11-0/bin/python: cannot execute binary file: Exec format error
ERROR:
cannot execute native linux-64 binary, output from 'uname -a' is:
Linux top-master 3.14.29-56 #1 SMP PREEMPT Wed Apr 20 12:15:54 BRT 2016 aarch64 aarch64 aarch64 GNU/Linux

我继续前进,尝试了基于 pip 的安装。

$ sudo pip3 install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0-cp34-cp34m-linux_x86_64.whl
tensorflow-0.8.0-cp34-cp34m-linux_x86_64.whl is not a supported wheel on this platform.

(同样的问题出现在 python 2.7 的 pip 上)

我已经看到一些类似的问题,尽管“不支持轮子”,但一些文件重命名技巧可以解决问题。重命名后,我可以安装 tensorflow:

$ sudo pip3 install tensorflow-0.8.0-cp35-none-any.whl 
Processing ./tensorflow-0.8.0-cp35-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): protobuf==3.0.0b2 in / usr/local/lib/python3.5/dist-packages (from tensorflow==0.8.0)
Requirement already satisfied (use --upgrade to upgrade): six>=1.10.0 in /usr/li b/python3/dist-packages (from tensorflow==0.8.0)
Requirement already satisfied (use --upgrade to upgrade): wheel>=0.26 in /usr/li b/python3/dist-packages (from tensorflow==0.8.0)
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.8.2 in /usr/l ib/python3/dist-packages (from tensorflow==0.8.0)
Requirement already satisfied (use --upgrade to upgrade): setuptools in /usr/lib /python3/dist-packages (from protobuf==3.0.0b2->tensorflow==0.8.0)
Installing collected packages: tensorflow
Successfully installed tensorflow-0.8.0

但是,在:

$ python3
Python 3.5.1+ (default, Mar 30 2016, 22:46:26)
[GCC 5.3.1 20160330] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow

我得到:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.5/dist-packages/tensorflow/__init__.py", line 23, in <module>
from tensorflow.python import *
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/__init__.py", line 45, in <module>
from tensorflow.python import pywrap_tensorflow
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
_pywrap_tensorflow = swig_import_helper()
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
File "/usr/lib/python3.5/imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "/usr/lib/python3.5/imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: /usr/local/lib/python3.5/dist-packages/tensorflow/python/_pywrap_tensorflow.so: cannot open shared object file: No such file or directory

重要的是,我注意到这个文件确实存在:

$ ls /usr/local/lib/python3.5/dist-packages/tensorflow/python
client __init__.py lib platform pywrap_tensorflow.py summary user_ops
framework kernel_tests ops __pycache__ _pywrap_tensorflow.so training util

和以前一样,使用 Python 2.7 重复相同的步骤会导致相同的问题(文件夹略有不同)。我不太确定如何进一步解决这个问题 - 我想下一步是尝试构建我自己的 tensorflow,但如果可以避免,那就太好了。

最佳答案

抱歉,扎克,您遇到问题了!我没有使用 odroid 的经验,但我发现直接在设备上编译是 Raspberry Pi 等平台的最佳方法。我们确实有至少一份关于同样适用于 odroid 的方法的报告: https://github.com/tensorflow/tensorflow/issues/254#issuecomment-216918727

这有帮助吗?

关于python - 使用 Tensorflow 0.8.0 的 Odroid C2 设置困难,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37120523/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com