【问题标题】:Tensorflow Built from Source CustomBuilt dont WorkTensorflow Build from Source Custom Build 不工作
【发布时间】:2019-09-04 14:36:22
【问题描述】:

我尝试在配备 Intel Xeon E5620 的服务器上安装 Rasa。 Rasa 需要 TensorFlow 14.0.0。我使用虚拟环境(Anaconda)

我必须从源代码编译 Tensorflow,因为 CPU 不支持 AVX。 我创建了一个使用docker-tensorflow-builder 构建的自定义并安装它。 当我测试它时,我得到了消息:

Traceback (most recent call last):
  File "/anaconda3/envs/ki/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/anaconda3/envs/ki/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/anaconda3/envs/ki/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "/anaconda3/envs/ki/lib/python3.6/imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "/anaconda3/envs/ki/lib/python3.6/imp.py", line 343, in load_dynamic
    return _load(spec)
ImportError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /anaconda3/envs/ki/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/anaconda3/envs/ki/lib/python3.6/site-packages/tensorflow/__init__.py", line 28, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "/anaconda3/envs/ki/lib/python3.6/site-packages/tensorflow/python/__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/anaconda3/envs/ki/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "/anaconda3/envs/ki/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/anaconda3/envs/ki/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/anaconda3/envs/ki/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "/anaconda3/envs/ki/lib/python3.6/imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "/anaconda3/envs/ki/lib/python3.6/imp.py", line 343, in load_dynamic
    return _load(spec)
ImportError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /anaconda3/envs/ki/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so)


Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/errors

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.

我通过安装 GlibC.2.30 来修复它。 现在我收到错误“分段错误(核心转储)错误”。 我想我得到了错误,因为 Tensorflow 不适合我的 CPU。 我不确定如何找到合适的编译器选项并最终设置它们。这里有没有人有经验可以帮助我?

【问题讨论】:

  • 我使用的是 Ubuntu 18.10。
  • 这似乎是 TensorFlow 特有的问题,与 Rasa 本身无关。

标签: tensorflow rasa


【解决方案1】:

这里的问题在于 gcc 版本。 tensorflow的安装请使用gcc 6.4.0。

以下是在 conda 环境中安装 Intel 优化的 tensorflow 的步骤。

conda create -n tf_1.10 -c intel python=3.6

source activate tf_1.10

确保 bash_profile 中有以下行并获取它。

export CC=/glob/development-tools/versions/gcc-6.4.0/bin/gcc

export LD_LIBRARY_PATH=/glob/development-tools/versions/gcc-6.4.0/lib64/:$LD_LIBRARY_PATH

export PATH=/glob/development-tools/versions/gcc-6.4.0/bin/:$PATH

如果路径设置成功,输入 gcc --version 应该可以看到 gcc 版本 6.4.0

如果您收到错误 ImportError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found,请按照以下步骤操作:

mkdir ~/lib

cd ~/lib

ln -s /glob/supplementary-software/versions/glibc/glibc_2_28/lib/libm.so.6

然后为它导出 LD_LIBRARY_PATH:

export LD_LIBRARY_PATH=~/lib:$LD_LIBRARY_PATH

然后,使用以下命令安装 tensorflow 1.10:

pip install https://storage.googleapis.com/intel-optimized-tensorflow/tensorflow-1.10.0-cp36-cp36m-linux_x86_64.whl

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-02
    • 2018-01-27
    • 2018-12-14
    • 2018-12-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多