首页 文章

错误在python 3.4中引入tensorflow“无法加载本机TensorFlow运行时”

提问于
浏览
1

回溯(最近一次调用最后一次):文件“/usr/local/lib/python3.4/dist-packages/tensorflow/python/ init .py ", line 61, in from tensorflow.python import pywrap_tensorflow File " /usr/local/lib/python3.4/dist-packages/tensorflow/ python / pywrap_tensorflow.py ", line 28, in _pywrap_tensorflow = swig_import_helper() File " /usr/local/lib/python3.4/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.4/imp.py“,第243行,在load_module中返回load_dynamic (名称,文件名,文件)ImportError:/opt/Xilinx/Vivado/2015.1/lib/lnx64.o/libstdc .so.6:找不到版本`GLIBCXX_3.4.19'(/ usr / local / lib / python3要求 . 4 / DIST-包/ tensorflow /蟒/ _pywrap_tensorflow.so)

在处理上述异常期间,发生了另一个异常:

回溯(最近一次调用最后一次):文件"image_resize.py",第10行,导入张量流为tf文件“/usr/local/lib/python3.4/dist-packages/tensorflow/ init .py ", line 24, in from tensorflow.python import * File " / usr / local / lib / python3 .4 / dist-packages / tensorflow / python / init .py ", line 72, in raise ImportError(msg) ImportError: Traceback (most recent call last): File " /usr/local/lib/python3.4/dist-packages/tensorflow/python/ init .py ", line 61, in from tensorflow.python import pywrap_tensorflow File " /usr/local/lib/python3.4/dist -packages / tensorflow / python / pywrap_tensorflow.py ", line 28, in _pywrap_tensorflow = swig_import_helper() File " /usr/local/lib/python3.4/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.4/imp.py“,第243行,在load_module中返回load_dynamic(名称,文件名,文件)ImportError:/opt/Xilinx/Vivado/2015.1/lib/lnx64.o/libstdc .so.6:找不到版本`GLIBCXX_3.4.19'(/ usr / local要求) /lib/python3.4/dist-packages/tensorflow/python/_pywrap_tensorflow.so)

无法加载本机TensorFlow运行时 .

https://github.com/tensorflow/tensorflow/blob/master/tensorflow/g3doc/get_started/os_setup.md#import_error

出于一些常见原因和解决方案 . 在寻求帮助时,请在此错误消息上方包括整个堆栈跟踪 .

我使用的是ubuntu 14.4和python 3.4版

2 回答

  • 1

    看起来您安装了包含旧版libstdc的Xilinx . 如果从 LD_LIBRARY_PATH 中删除它,那应该可以解决问题 .

  • 0

    我正在使用带有python 3.5的Ubuntu 14.4 . 我运行以下和python3 shell导入tensorflow非常好 .

    sudo -H pip3 install tensorflow
    

相关问题