某天師妹要用gpu版本的tf1.1.0 , 于是將cpu版本的tf1.1.0 卸載之:
sudo pip unintall tensorflow # ?注意 ?我之前也是使用pip 安裝的
# 所以可以這樣下載愿棋, 如果是源碼安裝的方式 糠雨,不應(yīng)該這樣卸載
但是訪問tensorflow.org的時(shí)候我發(fā)現(xiàn)只有0.12 版本的:
what? ?怎么辦徘跪? ?
還好細(xì)心的我發(fā)現(xiàn) tf的下載鏈接很有規(guī)律:
tf的下載鏈接的格式一般是:
TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/{gpu|cpu}/tensorflow_{gpu|cpu}-{版本號(hào)}-cp{35|27}-{none|cp35m|cp27m}-linux_x86_64.whl
找出了規(guī)律以后,cp35是適合于python35的tf, cp27是適合python27的鏈接 松邪; 就是一個(gè)一個(gè)的嘗試了哨查,這里比較頭大的是版本號(hào): 1.1.0rc1 是我在一個(gè)cpu 版本的連接上找到的:?
于是修改成這個(gè):?
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