Update TensorFlow
Asked Answered
S

8

43

I'm working with Ubuntu 14.04 , I had a TensorFlow V0.10 but I want to update this version. if i do:

$ pip install --upgrade $TF_BINARY_URL

but it prints:

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
Skitter answered 3/3, 2017 at 8:55 Comment(12)
Could be internet problem. Try reset router / using proxy?Salol
This is due to weak internet connection. Try setting default timeout (HTTP timeout) using pip --default-timeout=100 install --upgrade $TF_BINARY_URLLeucocyte
@Salol how i do this ?Skitter
@Leucocyte : an error You must give at least one requirement to install (see "pip help install") !Skitter
@Brm-Covißio : You haven't set the environment variable $TF_BINARY_URL. Try doing pip --default-timeout=100 install --upgrade tensorflowLeucocyte
@Leucocyte other error : Could not find any downloads that satisfy the requirement tensorflow in /usr/local/lib/python2.7/dist-packages Downloading/unpacking tensorflow Cleaning up... No distributions at all found for tensorflow in /usr/local/lib/python2.7/dist-packages Storing debug log for failure in /tmp/tmpHw3sqsSkitter
Try installing the package with a whl file: sudo pip --default-timeout=100 install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.0.0-cp27-none-linux_x86_64.whlLeucocyte
an error : tensorfl‌​ow-1.0.0-cp27-none-l‌​inux_x86_64.whl is not a supported wheel on this platform. Storing debug log for failure in /home/brm17/.pip/pip.logSkitter
@Leucocyte an error : tensorfl‌​ow-1.0.0-cp27-none-l‌​inux_x86_64.whl is not a supported wheel on this platform. Storing debug log for failure in /home/brm17/.pip/pip.log Skitter
help me please !Skitter
is not a supported wheel on this platform can be caused by old versions of pip as well; did you try pip install --upgrade pip?Procreant
Possible duplicate of How to Update Tensorflow from sourceCacao
O
98
(tensorflow)$ pip install --upgrade pip  # for Python 2.7
(tensorflow)$ pip3 install --upgrade pip # for Python 3.n

(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

(tensorflow)$ pip install --upgrade tensorflow-gpu==1.4.1 # for a specific version

Details on install tensorflow.

Overtone answered 17/11, 2017 at 3:2 Comment(3)
For me upgrading tensorflow alone made tensorflow giving errors. I have to upgrade the tensorflow-gpu also to get it workingBraxy
for Windows users, if you get ImportError: DLL load failed: The specified module could not be found. or Failed to load the native TensorFlow runtime.or similar, try updating MSVC Runtime to the latest as described in issue github.com/tensorflow/tensorflow/issues/35749Yul
Thank you! The command worked for me to upgrade TF to 2.8.0 (Python 3): pip install --upgrade tensorflow==2.8.0Maladjusted
M
28

To upgrade any python package, use pip install <pkg_name> --upgrade.

So in your case it would be pip install tensorflow --upgrade. Just updated to 1.1.0

Marinamarinade answered 27/4, 2017 at 2:33 Comment(1)
doesn't always work: No distributions at all found for tensorflow in /usr/local/lib/python3.4/dist-packagesInteroceptor
H
6

This is official recommendation for upgrading Tensorflow.

To get TensorFlow 1.5, you can use the standard pip installation (or pip3 if you use python3)

$  pip install --ignore-installed --upgrade tensorflow
Heaney answered 29/1, 2018 at 11:44 Comment(1)
Often you have to sudo the command: sudo pip3 install --ignore-installed --upgrade tensorflowSavonarola
O
6

Tensorflow upgrade -Python3

>> pip3 install --upgrade tensorflow --user

if you got this

"ERROR: tensorboard 2.0.2 has requirement grpcio>=1.24.3, but you'll have grpcio 1.22.0 which is incompatible."

Upgrade grpcio

>> pip3 install --upgrade grpcio --user
Outflow answered 13/12, 2019 at 6:5 Comment(0)
E
2

Before trying to update tensorflow try updating pip

pip install --upgrade pip

If you are upgrading from a previous installation of TensorFlow < 0.7.1, you should uninstall the previous TensorFlow and protobuf using,

pip uninstall tensorflow

to make sure you get a clean installation of the updated protobuf dependency.

Uninstall the TensorFlow on your system, and check out Download and Setup to reinstall again.

If you are using pip install, go check the available version over https://storage.googleapis.com/tensorflow, search keywords with linux/cpu/tensorflow to see the availabilities.

Then, set the path for download and execute in 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

For more detail, follow this link in here

Eliott answered 10/4, 2017 at 20:53 Comment(0)
E
2

For anaconda installation, first pick a channel which has the latest version of tensorflow binary. Usually, the latest versions are available at the channel conda-forge. Then simply do:

conda update -f -c conda-forge tensorflow

This will upgrade your existing tensorflow installation to the very latest version available. As of this writing, the latest version is 1.4.0-py36_0

Edmondo answered 12/12, 2017 at 4:23 Comment(0)
H
2

for a specific version

pip install --upgrade tensorflow==2.2
Hittel answered 17/11, 2020 at 7:6 Comment(0)
A
1

Upgrading to Tensorflow 2.0 using pip. Requires Python > 3.4 and pip >= 19.0

CST:~ USERX$ pip3 show tensorflow
Name: tensorflow
Version: 1.13.1

CST:~ USERX$ python3 --version
Python 3.7.3

CST:~ USERX$ pip3 install --upgrade tensorflow

CST:~ USERX$ pip3 show tensorflow
Name: tensorflow
Version: 2.0.0
Adamic answered 10/10, 2019 at 14:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.