最近想装tensorflow,网上一搜,全是16年的帖子,按照帖子中提供的安装链接,都不靠谱,总是报下面的错误:
Collecting tensorflow==0.9.0 from https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x20d0b50>, 'Connection to storage.googleapis.com timed out. (connect timeout=15)')': /tensorflow/linux/cpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x20bcc50>, 'Connection to storage.googleapis.com timed out. (connect timeout=15)')': /tensorflow/linux/cpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x20bcb50>, 'Connection to storage.googleapis.com timed out. (connect timeout=15)')': /tensorflow/linux/cpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl
/usr/local/python27/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
SNIMissingWarning
/usr/local/python27/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
仔细看,发现是网上提供的链接已经过时,经过摸索,发现tensorflow的官方下载https://github.com/tensorflow/tensorflow
用下面这个命令安装,轻松搞定
$sudo pip install https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-cpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON2,label=cpu-slave/lastSuccessfulBuild/artifact/pip_test/whl/tensorflow-1.0.0rc2-cp27-none-linux_x86_64.whl
但是接下来不断踩坑,
1. import tensorflow的时候报下面的错误
version `GLIBCXX_3.4.19' not found
查了下,这个是gcc版本问题,按照下面这个帖子安装好gcc4.8.1,搞定这个坑
http://www.yhaitao.net/centos6-5-compile-and-installgcc-4-8-1/
2. 再次import tensorflow,仍然有错误
version `GLIBC_2.16' not found
oooO ↘┏━┓ ↙ Oooo
( 踩)→┃你┃ ←(死 )
\ ( →┃√┃ ← ) /
\_)↗┗━┛ ↖(_/