简体   繁体   English

pip install --user --upgrade tensorflow-gpu 安装错误

[英]pip install --user --upgrade tensorflow-gpu INSTALL ERROR

Below the command shell error,在命令外壳错误下方,

(base) C:\Users\ImdaduL Haque> pip install --user --upgrade tensorflow-gpu
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/tensorflow-gpu/
Collecting tensorflow-gpu
  Downloading tensorflow_gpu-2.3.0-cp37-cp37m-win_amd64.whl (344.1 MB)
     |██▌                             | 28.1 MB 198 kB/s eta 0:26:33ERROR: Exception:
Traceback (most recent call last):
  File "c:\users\imdadul haque\anaconda3\lib\site-packages\pip\_vendor\urllib3\response.py", line 437, in _error_catcher
    yield
  File "c:\users\imdadul haque\anaconda3\lib\site-packages\pip\_vendor\urllib3\response.py", line 519, in read
    data = self._fp.read(amt) if not fp_closed else b""
  File "c:\users\imdadul haque\anaconda3\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 62, in read
    data = self.__fp.read(amt)
  File "c:\users\imdadul haque\anaconda3\lib\http\client.py", line 447, in read
    n = self.readinto(b)
  File "c:\users\imdadul haque\anaconda3\lib\http\client.py", line 491, in readinto
    n = self.fp.readinto(b)
  File "c:\users\imdadul haque\anaconda3\lib\socket.py", line 589, in readinto
    return self._sock.recv_into(b)
  File "c:\users\imdadul haque\anaconda3\lib\ssl.py", line 1052, in recv_into
    return self.read(nbytes, buffer)
  File "c:\users\imdadul haque\anaconda3\lib\ssl.py", line 911, in read
    return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\imdadul haque\anaconda3\lib\site-packages\pip\_internal\cli\base_command.py", line 216, in _main
    status = self.run(options, args)
  File "c:\users\imdadul haque\anaconda3\lib\site-packages\pip\_internal\cli\req_command.py", line 182, in wrapper
    return func(self, options, args)
  File "c:\users\imdadul haque\anaconda3\lib\site-packages\pip\_internal\commands\install.py", line 325, in run
    reqs, check_supported_wheels=not options.target_dir
  File "c:\users\imdadul haque\anaconda3\lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 183, in resolve
    discovered_reqs.extend(self._resolve_one(requirement_set, req))
  File "c:\users\imdadul haque\anaconda3\lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 388, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "c:\users\imdadul haque\anaconda3\lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 340, in _get_abstract_dist_for
    abstract_dist = self.preparer.prepare_linked_requirement(req)
  File "c:\users\imdadul haque\anaconda3\lib\site-packages\pip\_internal\operations\prepare.py", line 469, in prepare_linked_requirement
    hashes=self._get_linked_req_hashes(req)
  File "c:\users\imdadul haque\anaconda3\lib\site-packages\pip\_internal\operations\prepare.py", line 259, in unpack_url
    hashes=hashes,
  File "c:\users\imdadul haque\anaconda3\lib\site-packages\pip\_internal\operations\prepare.py", line 130, in get_http_url
    link, downloader, temp_dir.path, hashes
  File "c:\users\imdadul haque\anaconda3\lib\site-packages\pip\_internal\operations\prepare.py", line 282, in _download_http_url
    for chunk in download.chunks:
  File "c:\users\imdadul haque\anaconda3\lib\site-packages\pip\_internal\cli\progress_bars.py", line 168, in iter
    for x in it:
  File "c:\users\imdadul haque\anaconda3\lib\site-packages\pip\_internal\network\utils.py", line 88, in response_chunks
    decode_content=False,
  File "c:\users\imdadul haque\anaconda3\lib\site-packages\pip\_vendor\urllib3\response.py", line 576, in stream
    data = self.read(amt=amt, decode_content=decode_content)
  File "c:\users\imdadul haque\anaconda3\lib\site-packages\pip\_vendor\urllib3\response.py", line 541, in read
    raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
  File "c:\users\imdadul haque\anaconda3\lib\contextlib.py", line 130, in __exit__
    self.gen.throw(type, value, traceback)
  File "c:\users\imdadul haque\anaconda3\lib\site-packages\pip\_vendor\urllib3\response.py", line 442, in _error_catcher
    raise ReadTimeoutError(self._pool, None, "Read timed out.")
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

(base) C:\Users\ImdaduL Haque>

After run the command pip install --user --upgrade tensorflow-gpu it show the aboves error and I don't solve this issue.运行命令pip install --user --upgrade tensorflow-gpu 后,它显示上述错误,我没有解决这个问题。 Note: I don't run keras for low version of tensorflow, that's why i use these above commond but it's show the error.注意:我不为低版本的 tensorflow 运行 keras,这就是为什么我使用上面的这些,但它显示了错误。 below my previous questions link where i said the tensorflow version's issue.在我之前的问题链接下面,我说的是 tensorflow 版本的问题。

tensorflow version's issue link tensorflow 版本的问题链接

This happened because of your weak internet connection.这是因为您的互联网连接较弱。 Try again with the same command.使用相同的命令再试一次。 Or you can use the following command to increase waiting time:或者您可以使用以下命令来增加等待时间:

pip --default-timeout=100 install --user --upgrade tensorflow-gpu

There is no gpu or cpu specific version of tensorflow from version 2.0 onwards.从 2.0 版开始,没有特定于 GPU 或 CPU 的 tensorflow 版本。 If you just use pip install tensorflow , you'll install both cpu and gpu versions.如果您只使用pip install tensorflow ,您将同时安装 cpu 和 gpu 版本。 I you want to install for a cpu or gpu, you can install them for tensorflow v1.x only.如果您想为 cpu 或 gpu 安装,则只能为 tensorflow v1.x 安装它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM