Python 在aarch64上安装Tensorflow:错误:找不到满足Tensorflow要求的版本

Python 在aarch64上安装Tensorflow:错误:找不到满足Tensorflow要求的版本,python,tensorflow,pip,arm64,Python,Tensorflow,Pip,Arm64,我想在AARC64(Ubuntu16.04;Linux on DeX)上安装Tensorflow 尝试1:遵循与经典x86_64体系结构相同的步骤(在那里工作);看 与尝试1相关的帖子,但对于Windows是。其中一篇也找到了其他文章(类似的标题),但似乎没有一篇涉及ARM架构 尝试2:以下内容 在第三次尝试中,我试图跟随,但是 无法将Bazel作为步骤2从安装失败,因为没有aarch64版本(即使下载.tar.gz,编译也会失败,出现错误:如果不是从分发工件引导,则必须指定PROTOC 更多信

我想在AARC64(Ubuntu16.04;Linux on DeX)上安装Tensorflow

尝试1:遵循与经典x86_64体系结构相同的步骤(在那里工作);看

与尝试1相关的帖子,但对于Windows是。其中一篇也找到了其他文章(类似的标题),但似乎没有一篇涉及ARM架构

尝试2:以下内容

在第三次尝试中,我试图跟随,但是 无法将Bazel作为步骤2从安装失败,因为没有aarch64版本(即使下载.tar.gz,编译也会失败,出现
错误:如果不是从分发工件引导,则必须指定PROTOC

更多信息:
python--version
显示
2.7.12
python3--version
显示
3.5.2

更新

我尝试了hoefling对尝试1的建议=https://www.piwheels.org/simple就在
pip3安装之前——升级tensorflow
使后者可以正常工作,但启动
python3
并使用
import tensorflow作为tf
I仍然有效获取大的回溯输出:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/usr/local/lib/python3.5/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.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/lib/aarch64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by /usr/local/lib/python3.5/dist-packages/tensorflow/python/_pywrap_tensorflow_internal.so)

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.5/dist-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/usr/local/lib/python3.5/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.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/lib/aarch64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by /usr/local/lib/python3.5/dist-packages/tensorflow/python/_pywrap_tensorflow_internal.so)


Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_problems

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.
回溯(最近一次呼叫最后一次):
文件“/usr/local/lib/python3.5/dist packages/tensorflow/python/pywrap_tensorflow.py”,第58行,在
从tensorflow.python.pywrap\u tensorflow\u内部导入*
文件“/usr/local/lib/python3.5/dist packages/tensorflow/python/pywrap\u tensorflow\u internal.py”,第28行,在
_pywrap\u tensorflow\u internal=swig\u import\u helper()
swig\u import\u helper中的文件“/usr/local/lib/python3.5/dist packages/tensorflow/python/pywrap\u tensorflow\u internal.py”,第24行
_mod=imp.load_模块(“pywrap_tensorflow_internal”,fp,路径名,描述)
加载模块中的文件“/usr/lib/python3.5/imp.py”,第242行
返回加载动态(名称、文件名、文件)
文件“/usr/lib/python3.5/imp.py”,第342行,动态加载
返回负载(规格)
导入错误:/usr/lib/aarch64 linux gnu/libstdc++.so.6:找不到版本'GLIBCXX_3.4.22'(由/usr/local/lib/python3.5/dist packages/tensorflow/python/_pywrap_tensorflow_internal.so所需)
在处理上述异常期间,发生了另一个异常:
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
文件“/usr/local/lib/python3.5/dist-packages/tensorflow/_init__.py”,第24行,在
从tensorflow.python导入pywrapu tensorflow 35; pylint:disable=未使用的导入
文件“/usr/local/lib/python3.5/dist packages/tensorflow/python/_init__.py”,第49行,在
从tensorflow.python导入pywrap\u tensorflow
文件“/usr/local/lib/python3.5/dist packages/tensorflow/python/pywrap_tensorflow.py”,第74行,在
提高效率(msg)
ImportError:回溯(最近一次呼叫上次):
文件“/usr/local/lib/python3.5/dist packages/tensorflow/python/pywrap_tensorflow.py”,第58行,在
从tensorflow.python.pywrap\u tensorflow\u内部导入*
文件“/usr/local/lib/python3.5/dist packages/tensorflow/python/pywrap\u tensorflow\u internal.py”,第28行,在
_pywrap\u tensorflow\u internal=swig\u import\u helper()
swig\u import\u helper中的文件“/usr/local/lib/python3.5/dist packages/tensorflow/python/pywrap\u tensorflow\u internal.py”,第24行
_mod=imp.load_模块(“pywrap_tensorflow_internal”,fp,路径名,描述)
加载模块中的文件“/usr/lib/python3.5/imp.py”,第242行
返回加载动态(名称、文件名、文件)
文件“/usr/lib/python3.5/imp.py”,第342行,动态加载
返回负载(规格)
导入错误:/usr/lib/aarch64 linux gnu/libstdc++.so.6:找不到版本'GLIBCXX_3.4.22'(由/usr/local/lib/python3.5/dist packages/tensorflow/python/_pywrap_tensorflow_internal.so所需)
未能加载本机TensorFlow运行时。
看见https://www.tensorflow.org/install/install_sources#common_installation_problems
由于一些常见的原因和解决方案。包括整个堆栈跟踪
以上是请求帮助时的错误消息。

我在
https://github.com/lhelontra/tensorflow-on-arm/issues/13
。简言之,我在
aarch64
中遗漏了某些预备工作。以下是解决方案:

# Preliminaries
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install gcc-4.9
sudo apt install --only-upgrade libstdc++6

# Installation similar to Ubuntu on x86_64
sudo apt update
sudo apt install python3-dev python3-pip virtualenv
sudo -H pip3 install --upgrade virtualenv
mkdir /usr/local/tensorflow
virtualenv --system-site-packages -p python3 /usr/local/tensorflow/
source /usr/local/tensorflow/bin/activate
pip3 install --upgrade tensorflow
deactivate

# Test
source /usr/local/tensorflow/bin/activate
$ python3
>>> import tensorflow as tf
>>> hello = tf.constant("Hello, World!")
>>> sess = tf.Session()
>>> print(sess.run(hello))

大家好,在我下载并安装之后,解决了我CPU上的上述导入张量流错误 微软Visual C++ +2015-2019可重分发(X64) 我的笔记本电脑上有VC_redist.x64版本。希望这对其他人有所帮助

我最初安装了Anaconda3.7Python版本,现在使用conda命令提示符
从Anaconda成功地安装了tensor flow,它工作正常。但在导入tensor flow时,我遇到了上述问题。
我甚至安装了msv140dll,但在我下载并运行之前它仍然无法工作
VC_redist.x64版本。在这之后,一切都正常了

您是否尝试从piwheels安装?
pip安装tensorflow--额外的索引url=https://www.piwheels.org/simple
。尽管控制盘是为raspberry pi而设计的,但其中一些控制盘非常通用,可以在任意ARM硬件上工作。您好,谢谢您的帮助。我在机器人上提供了一个更新tom.我仍然得到相同的错误(输出),但您可能从这里看到了一些东西。(不幸的是,Linux on DeX已经停止使用)
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/usr/local/lib/python3.5/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.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/lib/aarch64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by /usr/local/lib/python3.5/dist-packages/tensorflow/python/_pywrap_tensorflow_internal.so)

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.5/dist-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/usr/local/lib/python3.5/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.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/lib/aarch64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by /usr/local/lib/python3.5/dist-packages/tensorflow/python/_pywrap_tensorflow_internal.so)


Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_problems

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.
# Preliminaries
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install gcc-4.9
sudo apt install --only-upgrade libstdc++6

# Installation similar to Ubuntu on x86_64
sudo apt update
sudo apt install python3-dev python3-pip virtualenv
sudo -H pip3 install --upgrade virtualenv
mkdir /usr/local/tensorflow
virtualenv --system-site-packages -p python3 /usr/local/tensorflow/
source /usr/local/tensorflow/bin/activate
pip3 install --upgrade tensorflow
deactivate

# Test
source /usr/local/tensorflow/bin/activate
$ python3
>>> import tensorflow as tf
>>> hello = tf.constant("Hello, World!")
>>> sess = tf.Session()
>>> print(sess.run(hello))