如何手动下载Pytorch?

d7v8vwbk  于 2023-04-30  发布在  其他
关注(0)|答案(1)|浏览(172)

你好,我正在尝试使用一些需要pytorch的python程序,当尝试使用命令安装它时

pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

这是我得到的错误

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x00000183D80F60B0>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed')': /whl/cu118/torch/                                                     
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x00000183D80F63E0>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed')': /whl/cu118/torch/                                                     
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x00000183D80F6590>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed')': /whl/cu118/torch/                                                     
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x00000183D80F6740>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed')': /whl/cu118/torch/                                                     
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x00000183D80F68F0>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed')': /whl/cu118/torch/                                                     
ERROR: Could not find a version that satisfies the requirement torch (from versions: none)                              ERROR: No matching distribution found for torch                                                                         WARNING: There was an error checking the latest version of pip.

我可以通过使用vpn解决这个问题,但问题是pytorch是一个非常大的包,它不断被中断,我必须一次又一次地从头开始,所以我需要一种方法来下载软件包手动下载管理器支持下载恢复,并想知道如何才能做到这一点,因为我是一个noob当谈到python谢谢。

dsf9zpds

dsf9zpds1#

一种方法是:
1.转到download.pytorch.org/whl/cu118
1.选择torch
1.下载对应于您想要的pytorch和python版本的文件。
1.使用pip与whl文件一起安装,而不是--index-url选项。
如果你真的需要它,只需要pip install torchvision torchaudio
如果第一次下载仍然卡住,那么这不是Pytorch服务器的问题,而是您的计算机的问题。
注:使用文件torch-2.0.0+cu118-cp39-cp39-win_amd64.whl进行测试

相关问题