Python 更新TensorFlow
我正在使用Python 更新TensorFlow,python,tensorflow,deep-learning,upgrade,Python,Tensorflow,Deep Learning,Upgrade,我正在使用ubuntu14.04,我有一个tensorflowv0.10,但我想更新这个版本。 如果我这样做: $ 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(
ubuntu14.04
,我有一个tensorflowv0.10
,但我想更新这个版本。
如果我这样做:
$ 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
在尝试更新tensorflow之前,请尝试更新pip
pip install --upgrade pip
如果您是从以前安装的TensorFlow<0.7.1升级,则应使用
pip uninstall tensorflow
以确保干净地安装更新的protobuf依赖项
卸载系统上的TensorFlow,然后签出
如果您正在使用pip安装,请检查可用版本,使用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
有关更多详细信息,请按照中的此链接升级任何python软件包,请使用
pip安装--upgrade
因此,在您的情况下,应该是pip安装tensorflow——升级。刚刚更新到1.1.0
(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
有关的详细信息。对于anaconda安装,首先选择具有最新版本tensorflow binary的通道。通常,最新版本可在conda forge频道获得。然后简单地做:
conda update -f -c conda-forge tensorflow
这将把您现有的tensorflow安装升级到最新版本。在撰写本文时,最新版本是1.4.0-py36_0
这是升级Tensorflow的官方建议
要获得TensorFlow 1.5,可以使用标准pip安装(如果使用python3,则使用pip3)
使用pip升级到Tensorflow 2.0。
需要Python>3.4和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
Tensorflow升级-Python3
>> pip3 install --upgrade tensorflow --user
如果您得到了这个
错误:tensorboard 2.0.2要求grpcio>=1.24.3,但您将
具有不兼容的grpcio 1.22.0。”
升级grpcio
>> pip3 install --upgrade grpcio --user
对于特定版本
pip install --upgrade tensorflow==2.2
可能是网络问题。尝试重置路由器/使用代理?这是由于internet连接薄弱。尝试使用pip设置默认超时(HTTP超时)——默认超时=100安装——升级$TF\u二进制文件_URL@Kh40tiK我是如何做到这一点的?@Prabhjot:a错误您必须给出至少一个安装要求(请参阅“pip帮助安装”)
@Brm Covißio:您尚未设置环境变量$TF_BINARY_URL。尝试执行pip--默认超时=100安装--升级tensorflow并不总是有效:在/usr/local/lib/python3.4/dist-packages中找不到tensorflow的任何发行版通常您必须执行以下命令:sudo pip3 install--ignore installed--upgrade tensorflow for me升级tensorflow单独升级tensorflow会导致tensorflow出现错误。我还必须升级tensorflow gpu以使其为Windows用户工作,如果您获得ImportError:DLL加载失败:找不到指定的模块。
或未能加载本机tensorflow运行时。
或类似内容,请尝试将MSVC运行时更新为最新版本,如本期所述
pip install --upgrade tensorflow==2.2