0

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

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

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。我不确定如何找到合适的编译器选项并最终设置它们。这里有没有人有经验可以帮助我?

4

1 回答 1

1

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

以下是在 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
于 2019-09-17T06:33:27.797 回答