web-dev-qa-db-ja.com

ImportError:/ lib64 / libstdc ++。so.6:バージョン `CXXABI_1.3.8 'が見つかりません

大学のクラスターでディープラーニングモデルを実行しようとしています。モデルを実行するコマンドを作成すると、このエラーが発生します。

15CS10019@cpusrv-gpu-112:~/Tushar/Rod-keras_yolo2-master$ python3 train.py -c config.json
Using TensorFlow backend.
Traceback (most recent call last):
  File "/home/bt3/15CS10019/.local/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/home/bt3/15CS10019/.local/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/home/bt3/15CS10019/.local/lib/python3.7/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 "/usr/local/lib/python3.7/imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "/usr/local/lib/python3.7/imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /home/bt3/15CS10019/.local/lib/python3.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "train.py", line 3, in <module>
    from keras_yolov2.preprocessing import parse_annotation_xml, parse_annotation_csv
  File "/home/bt3/15CS10019/Tushar/Rod-keras_yolo2-master/keras_yolov2/preprocessing.py", line 1, in <module>
    from .utils import BoundBox, bbox_iou
  File "/home/bt3/15CS10019/Tushar/Rod-keras_yolo2-master/keras_yolov2/utils.py", line 1, in <module>
    from .backend import (TinyYoloFeature, FullYoloFeature, MobileNetFeature, SqueezeNetFeature, Inception3Feature,
  File "/home/bt3/15CS10019/Tushar/Rod-keras_yolo2-master/keras_yolov2/backend.py", line 1, in <module>
    from keras.models import Model
  File "/usr/local/lib/python3.7/site-packages/keras/__init__.py", line 3, in <module>
    from . import utils
  File "/usr/local/lib/python3.7/site-packages/keras/utils/__init__.py", line 6, in <module>
    from . import conv_utils
  File "/usr/local/lib/python3.7/site-packages/keras/utils/conv_utils.py", line 9, in <module>
    from .. import backend as K
  File "/usr/local/lib/python3.7/site-packages/keras/backend/__init__.py", line 89, in <module>
    from .tensorflow_backend import *
  File "/usr/local/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py", line 5, in <module>
    import tensorflow as tf
  File "/home/bt3/15CS10019/.local/lib/python3.7/site-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "/home/bt3/15CS10019/.local/lib/python3.7/site-packages/tensorflow/python/__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/home/bt3/15CS10019/.local/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "/home/bt3/15CS10019/.local/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/home/bt3/15CS10019/.local/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "/home/bt3/15CS10019/.local/lib/python3.7/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 "/usr/local/lib/python3.7/imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "/usr/local/lib/python3.7/imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /home/bt3/15CS10019/.local/lib/python3.7/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.

このエラーをどのように解決すればよいですか?

1
Tushar Sinha

CXXABI_1.3.8をサポートするバージョンのgccをインストールする必要があります。

まず、現在のバージョンを確認して、次のコマンドを実行します。

gcc -v

マシンでc ++標準ライブラリを見つけて、以下を実行します。

Sudo find / -name 'libstdc++.so.6'

ライブラリの内部を見て、実行します。

strings /lib64/libstdc++.so.6 | grep '^CXXABI_'

以下の手順に従って、新しいバージョンのgccをコンパイルします。

# Install dependencies
Sudo yum check-update
Sudo yum -y install wget make gcc-c++

# Download gcc new version
wget -O - 'https://ftpmirror.gnu.org/gcc/gcc-7.3.0/gcc-7.3.0.tar.xz' | tar -xJ

# This helps if you are behind a proxy
sed -i 's/ftp:/https:/' ./gcc-7.3.0/contrib/download_prerequisites

# Finally compile gcc 
( cd gcc-7.3.0 && ./contrib/download_prerequisites && mkdir build && cd build && ../configure --enable-checking=release --enable-languages=c,c++ --disable-multilib && make -j 8 && Sudo make install ) && rm -fR gcc-7.3.0

# Unlink current version
Sudo unlink /usr/lib64/libstdc++.so.6

# Copy new version
Sudo cp /usr/local/lib64/libstdc++.so.6 /usr/lib64
1
Bruno Wego