2017-03-03 71 views
2

我正在使用Ubuntu 14.04,我有一個TensorFlow V0.10但我想更新此版本。 如果我這樣做:更新TensorFlow

$ pip install --upgrade $TF_BINARY_URL 

但它打印:

Exception: 
Traceback (most recent call last): 
    File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main 
    status = self.run(options, args) 
    File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 278, in run 
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle) 
    File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1198, in prepare_files 
    do_download, 
    File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1376, in unpack_url 
    self.session, 
    File "/usr/lib/python2.7/dist-packages/pip/download.py", line 572, in unpack_http_url 
    download_hash = _download_url(resp, link, temp_location) 
    File "/usr/lib/python2.7/dist-packages/pip/download.py", line 433, in _download_url 
    for chunk in resp_read(4096): 
    File "/usr/lib/python2.7/dist-packages/pip/download.py", line 421, in resp_read 
    chunk_size, decode_content=False): 
    File "/usr/share/python-wheels/urllib3-1.7.1-py2.py3-none-any.whl/urllib3/response.py", line 225, in stream 
    data = self.read(amt=amt, decode_content=decode_content) 
    File "/usr/share/python-wheels/urllib3-1.7.1-py2.py3-none-any.whl/urllib3/response.py", line 174, in read 
    data = self._fp.read(amt) 
    File "/usr/lib/python2.7/httplib.py", line 573, in read 
    s = self.fp.read(amt) 
    File "/usr/lib/python2.7/socket.py", line 380, in read 
    data = self._sock.recv(left) 
    File "/usr/lib/python2.7/ssl.py", line 341, in recv 
    return self.read(buflen) 
    File "/usr/lib/python2.7/ssl.py", line 260, in read 
    return self._sslobj.read(len) 
SSLError: The read operation timed out 

Storing debug log for failure in /home/brm17/.pip/pip.log 
+0

可能是網絡問題。嘗試重置路由器/使用代理? – Kh40tiK

+0

這是因爲互聯網連接較弱。嘗試使用 設置默認超時(HTTP超時)** pip --default-timeout = 100 install --upgrade $ TF_BINARY_URL ** – Prabhjot

+0

@ Kh40tiK我該怎麼做? –

回答

1

之前嘗試更新tensorflow嘗試更新PIP

pip install --upgrade pip 

如果從以前的安裝TensorFlow < 0.7的升級.1,您應該卸載以前的TensorFlowprotobuf使用,

pip uninstall tensorflow 

,以確保你得到一個乾淨的安裝更新的protobuf的依賴。

卸載系統上的TensorFlow,並檢出Download and Setup to reinstall again

如果您正在使用PIP安裝,去檢查可用的版本在https://storage.googleapis.com/tensorflow,使用Linux/CPU/tensorflow搜索關鍵詞,看其可用性。

然後,在sudo中設置下載和執行的路徑。

$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.0.0-py2-none-any.whl 

$ sudo pip install --upgrade $TF_BINARY_URL 

更多詳細信息,請按照here

15

升級任何Python包,使用​​此鏈接。

所以在你的情況下,它將是pip install tensorflow --upgrade。剛剛更新到1.1.0

+0

並不總是工作:沒有發現任何分發張量流在/usr/local/lib/python3.4/dist-packages中 – Alex

10
(tensorflow)$ pip install --upgrade tensorflow  # for Python 2.7 
(tensorflow)$ pip3 install --upgrade tensorflow  # for Python 3.n 
(tensorflow)$ pip install --upgrade tensorflow-gpu # for Python 2.7 and GPU 
(tensorflow)$ pip3 install --upgrade tensorflow-gpu # for Python 3.n and GPU 

細節上install tensorflow

1

對於Anaconda安裝,先摘通道擁有最新版本tensorflow二進制的。通常,最新版本可在頻道conda-forge上獲得。然後簡單地做:

conda update -f -c conda-forge tensorflow 

這將升級您現有的張量流安裝到可用的最新版本。在撰寫本文時,最新版本爲1.4.0-py36_0

0

這是用於升級Tensorflow的官方建議。

要獲得TensorFlow 1.5,你可以使用標準的PIP安裝(或PIP 3,如果你使用python3)

$ pip install --ignore-installed --upgrade tensorflow