某天师妹要用gpu版本的tf1.1.0 , 于是将cpu版本的tf1.1.0 卸载之:
sudo pip unintall tensorflow # 注意 我之前也是使用pip 安装的
# 所以可以这样下载, 如果是源码安装的方式 ,不应该这样卸载
但是访问tensorflow.org的时候我发现只有0.12 版本的:
what? 怎么办?
还好细心的我发现 tf的下载链接很有规律:
tf的下载链接的格式一般是:
TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/{gpu|cpu}/tensorflow_{gpu|cpu}-{版本号}-cp{35|27}-{none|cp35m|cp27m}-linux_x86_64.whl
找出了规律以后,cp35是适合于python35的tf, cp27是适合python27的链接 ; 就是一个一个的尝试了,这里比较头大的是版本号: 1.1.0rc1 是我在一个cpu 版本的连接上找到的:
于是修改成这个:
TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.1.0rc1-cp27-none-linux_x86_64.whl
安装信息如下:
sudo pip install --ignore-installed --no-cache-dir --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.2.0rc1-cp27-none-linux_x86_64.whl
Collecting tensorflow-gpu==1.2.0rc1 from https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.2.0rc1-cp27-none-linux_x86_64.whl
/usr/local/lib/python2.7/dist-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/lib/python2.7/dist-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
Downloading https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.2.0rc1-cp27-none-linux_x86_64.whl (89.2MB)
100% |████████████████████████████████| 89.2MB 912kB/s
Collecting six>=1.10.0 (from tensorflow-gpu==1.2.0rc1)
/usr/local/lib/python2.7/dist-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
Downloading six-1.10.0-py2.py3-none-any.whl
Collecting protobuf>=3.2.0 (from tensorflow-gpu==1.2.0rc1)
Downloading protobuf-3.3.0-cp27-cp27mu-manylinux1_x86_64.whl (5.7MB)
100% |████████████████████████████████| 5.7MB 109kB/s
Collecting mock>=2.0.0 (from tensorflow-gpu==1.2.0rc1)
Downloading mock-2.0.0-py2.py3-none-any.whl (56kB)
100% |████████████████████████████████| 61kB 96kB/s
Collecting html5lib==0.9999999 (from tensorflow-gpu==1.2.0rc1)
Downloading html5lib-0.9999999.tar.gz (889kB)
100% |████████████████████████████████| 890kB 85kB/s
Collecting werkzeug>=0.11.10 (from tensorflow-gpu==1.2.0rc1)
Downloading Werkzeug-0.12.2-py2.py3-none-any.whl (312kB)
100% |████████████████████████████████| 317kB 65kB/s
Collecting bleach==1.5.0 (from tensorflow-gpu==1.2.0rc1)
Downloading bleach-1.5.0-py2.py3-none-any.whl
Collecting numpy>=1.11.0 (from tensorflow-gpu==1.2.0rc1)
Downloading numpy-1.13.1-cp27-cp27mu-manylinux1_x86_64.whl (16.6MB)
100% |████████████████████████████████| 16.6MB 83kB/s
Collecting markdown==2.2.0 (from tensorflow-gpu==1.2.0rc1)
Downloading Markdown-2.2.0.tar.gz (236kB)
100% |████████████████████████████████| 245kB 74kB/s
Collecting wheel (from tensorflow-gpu==1.2.0rc1)
Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB)
100% |████████████████████████████████| 71kB 108kB/s
Collecting setuptools (from protobuf>=3.2.0->tensorflow-gpu==1.2.0rc1)
Downloading setuptools-36.2.7-py2.py3-none-any.whl (477kB)
100% |████████████████████████████████| 481kB 75kB/s
Collecting funcsigs>=1; python_version < "3.3" (from mock>=2.0.0->tensorflow-gpu==1.2.0rc1)
Downloading funcsigs-1.0.2-py2.py3-none-any.whl
Collecting pbr>=0.11 (from mock>=2.0.0->tensorflow-gpu==1.2.0rc1)
Downloading pbr-3.1.1-py2.py3-none-any.whl (99kB)
100% |████████████████████████████████| 102kB 66kB/s
Installing collected packages: six, setuptools, protobuf, funcsigs, pbr, mock, html5lib, werkzeug, bleach, numpy, markdown, wheel, tensorflow-gpu
Running setup.py install for html5lib ... done
Running setup.py install for markdown ... done
Successfully installed bleach-2.0.0 funcsigs-1.0.2 html5lib-0.999999999 markdown-2.2.0 mock-2.0.0 numpy-1.13.1 pbr-3.1.1 protobuf-3.3.0 setuptools-36.2.7 six-1.10.0 tensorflow-gpu-1.2.0rc1 werkzeug-0.12.2 wheel-0.29.0