使用 pip 安裝 TensorFlow

命令:pip3 install -U pip virtualenv

錯誤1:
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) a
fter connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.V
erifiedHTTPSConnection object at 0x0000000004689148>, 'Connection to pypi.org ti
med out. (connect timeout=15)')': /simple/pip/

解決辦法:
設置代理
pip3  --proxy http://XXXXXXX:80 install -U pip virtualen

錯誤2:
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None))
after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFI
CATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certif
icate (_ssl.c:1076)'))': /packages/db/9e/df208b2baad146fe3fbe750eacadd6e49bcf2f2
c3c1117b7192a7b28aec4/virtualenv-16.7.2-py2.py3-none-any.whl

解決辦法:
設置信任
pip3  --proxy http://XXXXXXX:80  --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org install -U pip virtualen

 

命令:pip install --upgrade pip

錯誤3:
ERROR: Could not install packages due to an EnvironmentError: [WinError 5] アク
セスが拒否されました。: 'C:\\Users\\XXXXX\\AppData\\Local\\Temp\\pip-uninstal
l-1vv0f5e0\\pip.exe'
Consider using the `--user` option or check the permissions.

解決辦法:
--user添加
pip  --proxy http://XXXXXXX:80  --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org install --upgrade pip --user

 

 

錯誤4:
FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecat
ed; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)t
ype'.

解決辦法:
問題在於numpy1.17.0版本過高,我換成了numpy1.16.0
卸載1.17.0
pip uninstall numpy
安裝1.16.0
pip  --proxy http://XXXXXXX:80  --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org install numpy==1.16

 

錯誤5:
I tensorflow/core/platform/cpu_feature_guard.cc:142]
 Your CPU supports instructions that this TensorFlow binary was not compiled to
use: AVX2

解決辦法:暫時屏蔽這些warning輸出的辦法.
import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章