【问题标题】:Failed to load the native TensorFlow runtime after following the installation instructions按照安装说明加载原生 TensorFlow 运行时失败
【发布时间】:2017-12-05 18:32:06
【问题描述】:

我正在尝试在 Ubuntu 上安装 SyntaxNet,我遵循了 Ubuntu 16.10+ 二进制安装说明here。当我运行最后一个命令时:

python -c 'import dragnn.python.load_dragnn_cc_impl, syntaxnet.load_parser_ops'

我在下面收到一长串错误消息:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/dragnn/python/load_dragnn_cc_impl.py", line 19, in <module>
    import tensorflow as tf
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import *
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/__init__.py", line 51, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 52, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 41, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
ImportError: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by /usr/local/lib/python2.7/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.

我检查了常见的安装问题页面,但似乎还没有解决此问题的方法。有没有人在安装 SyntaxNet 时遇到类似的问题?非常感谢您的帮助。

【问题讨论】:

    标签: python tensorflow nlp syntaxnet


    【解决方案1】:

    您需要安装最新的 libstdc++6。

    1. 检查版本

      字符串 /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX

    2. 添加仓库

      sudo add-apt-repository ppa:ubuntu-toolchain-r/test

    3. 安装

      sudo apt-get 更新 sudo apt-get dist-upgrade # 这个命令我用过,我猜下面的命令应该也可以。

      sudo apt-get install libstdc++6

    我关注了这个:How to fix: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found

    【讨论】:

    • 非常感谢!现在似乎一切正常
    猜你喜欢
    • 2021-01-07
    • 2020-08-24
    • 2018-03-20
    • 2018-03-25
    • 2019-06-01
    • 1970-01-01
    • 2020-04-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多