CentOS6.5系统"libc.so.6: version 'GLIBC_2.15' not found"处理

场景

安装TensorFlow后启动项目index.py时,报错:libc.so.6: version ‘GLIBC_2.15’ not found;
CentOS6.5系统"libc.so.6: version 'GLIBC_2.15' not found"处理
CentOS6.5系统"libc.so.6: version 'GLIBC_2.15' not found"处理

分析

由于glibc版本过低,升级glibc即可。由于CentOS系统RPM源目前glibc最高版本是2.12,所以只能采用源码升级,下载glibc-2.15.tar.gz

1)查看系统glibc支持的版本
strings /lib64/libc.so.6 |grep GLIBC //可看到支持的版本最新是2.12

#查看当前glibc版本
ll /lib64/libc.so.6
lrwxrwxrwx. 1 root root 12 2月 5 2018 /lib64/libc.so.6 -> libc-2.12.so

2)下载glibc源码包(找个可以上网的,比如DMZ区的主机,然后再通过内网传送到目标主机)
cd /usr/src/
wget http://mirror.bjtu.edu.cn/gnu/glibc/glibc-2.15.tar.gz
wget http://mirror.bjtu.edu.cn/gnu/glibc/glibc-ports-2.15.tar.gz      #glibc插件
3)解压安装升级glibc
tar zxvf glibc-2.15.tar.gz
tar zxvf glibc-ports-2.15.tar.gz
mv glibc-ports-2.15 glibc-2.15/ports
mkdir build
cd build
…/glibc-2.15/configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
make -j4
make install
CentOS6.5系统"libc.so.6: version 'GLIBC_2.15' not found"处理
4)验证

查看当前系统glibc支持的版本

strings /lib64/libc.so.6 |grep GLIBC
CentOS6.5系统"libc.so.6: version 'GLIBC_2.15' not found"处理
5)查看当前glibc版本

ll /lib64/libc.so.6
CentOS6.5系统"libc.so.6: version 'GLIBC_2.15' not found"处理

6)五、误删libc.so.6解决办法

命令行执行如下:

#LD_PRELOAD=/lib/libc-2.12.so ln -s /lib/libc-2.12.so lib/libc.so.6

7)实际验证glic-1.15安装后还是报错,故降低tensorflow版本为Version: 1.6.0

#home/qc/python3/bin/pip3 uninstall tensorflow
CentOS6.5系统"libc.so.6: version 'GLIBC_2.15' not found"处理
重新安装:/home/qc/python3/bin/pip3 install tensorflow==1.6
CentOS6.5系统"libc.so.6: version 'GLIBC_2.15' not found"处理
8)安装还报错找不到glibXX,是因为升级gcc时,生成的动态库没有替换老版本gcc的动态库。
find / -name libstdc++.so.6*
CentOS6.5系统"libc.so.6: version 'GLIBC_2.15' not found"处理
做软连接到/usr/lib64下:
cp /usr/local/gcc/lib64/libstdc++.so.6.0.19 /usr/lib64/
rm -rf /usr/lib64/libstdc++.so.6
ln -s /usr/lib64/libstdc++.so.6.0.19 /usr/lib64/libstdc++.so.6
再次验证:
CentOS6.5系统"libc.so.6: version 'GLIBC_2.15' not found"处理
可见GLIBCXX_3.4.17已经存在;
/home/qc/python3/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:517: FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / ‘(1,)type’.
_np_qint8 = np.dtype([(“qint8”, np.int8, 1)])
/home/qc/python3/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:518: FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / ‘(1,)type’.
_np_quint8 = np.dtype([(“quint8”, np.uint8, 1)])
/home/qc/python3/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:519: FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / ‘(1,)type’.
_np_qint16 = np.dtype([(“qint16”, np.int16, 1)])
/home/qc/python3/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:520: FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / ‘(1,)type’.
_np_quint16 = np.dtype([(“quint16”, np.uint16, 1)])
/home/qc/python3/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:521: FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / ‘(1,)type’.
_np_qint32 = np.dtype([(“qint32”, np.int32, 1)])
/home/qc/python3/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:526: FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / ‘(1,)type’.
np_resource = np.dtype([(“resource”, np.ubyte, 1)])
Traceback (most recent call last):
File “/usr/local/ECT/IndexElect.py”, line 19, in
from func import VideoRec,PersonRec
File “/usr/local/ECT/func/VideoRec.py”, line 24, in
CouplingBox=DetectionModel(CouplingBoxPb_Path,CouplingBoxLabel,CouplingBoxClass)
File “/usr/local/ECT/func/ElectFun.py”, line 28, in init
self.graph = self.LoadGraph()
File “/usr/local/ECT/func/ElectFun.py”, line 45, in LoadGraph
graph_def.ParseFromString(f.read())
File “/home/qc/python3/lib/python3.6/site-packages/tensorflow/python/lib/io/file_io.py”, line 120, in read
self._preread_check()
File “/home/qc/python3/lib/python3.6/site-packages/tensorflow/python/lib/io/file_io.py”, line 80, in _preread_check
compat.as_bytes(self.__name), 1024 * 512, status)
File “/home/qc/python3/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py”, line 516, in exit
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.NotFoundError: models/video/Resnet50VideoGray.pb; No such file or directory
[[email protected] gcc]# vim /usr/local/ECT/IndexElect.py
[[email protected] gcc]# /home/qc/python3/bin/python3.6 /usr/local/ECT/IndexElect.py
/home/qc/python3/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:517: FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / ‘(1,)type’.
_np_qint8 = np.dtype([(“qint8”, np.int8, 1)])
/home/qc/python3/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:518: FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / ‘(1,)type’.
_np_quint8 = np.dtype([(“quint8”, np.uint8, 1)])
/home/qc/python3/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:519: FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / ‘(1,)type’.
_np_qint16 = np.dtype([(“qint16”, np.int16, 1)])
/home/qc/python3/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:520: FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / ‘(1,)type’.
_np_quint16 = np.dtype([(“quint16”, np.uint16, 1)])
/home/qc/python3/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:521: FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / ‘(1,)type’.
_np_qint32 = np.dtype([(“qint32”, np.int32, 1)])
/home/qc/python3/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:526: FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / ‘(1,)type’.
np_resource = np.dtype([(“resource”, np.ubyte, 1)])
Traceback (most recent call last):
File “/usr/local/ECT/IndexElect.py”, line 19, in
from func import VideoRec,PersonRec
File “/usr/local/ECT/func/VideoRec.py”, line 24, in
CouplingBox=DetectionModel(CouplingBoxPb_Path,CouplingBoxLabel,CouplingBoxClass)
File “/usr/local/ECT/func/ElectFun.py”, line 28, in init
self.graph = self.LoadGraph()
File “/usr/local/ECT/func/ElectFun.py”, line 45, in LoadGraph
graph_def.ParseFromString(f.read())
File “/home/qc/python3/lib/python3.6/site-packages/tensorflow/python/lib/io/file_io.py”, line 120, in read
self._preread_check()
File “/home/qc/python3/lib/python3.6/site-packages/tensorflow/python/lib/io/file_io.py”, line 80, in _preread_check
compat.as_bytes(self.__name), 1024 * 512, status)
File “/home/qc/python3/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py”, line 516, in exit
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.NotFoundError: models/video/Resnet50VideoGray.pb; No such file or directory