Pytorch安装遇到网络问题

在运行

conda install pytorch==1.11.0 torchvision cudatoolkit -c pytorch

出现问题

(GAN) D:\0code\vision>conda install pytorch==1.11.0 torchvision cudatoolkit -c pytorch
Collecting package metadata (current_repodata.json): - DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): repo.anaconda.com:443
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): mirrors.tuna.tsinghua.edu.cn:443
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): conda.anaconda.org:443
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): mirrors.tuna.tsinghua.edu.cn:443
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): repo.anaconda.com:443
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): mirrors.tuna.tsinghua.edu.cn:443
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): mirrors.tuna.tsinghua.edu.cn:443
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): repo.anaconda.com:443
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): conda.anaconda.org:443
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): repo.anaconda.com:443
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): mirrors.tuna.tsinghua.edu.cn:443
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): mirrors.tuna.tsinghua.edu.cn:443
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): repo.anaconda.com:443
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): repo.anaconda.com:443
\ DEBUG:urllib3.connectionpool:https://mirrors.tuna.tsinghua.edu.cn:443 "GET /anaconda/cloud/conda-forge/win-64/current_repodata.json HTTP/1.1" 304 0
DEBUG:urllib3.connectionpool:https://mirrors.tuna.tsinghua.edu.cn:443 "GET /anaconda/cloud/msys2/win-64/current_repodata.json HTTP/1.1" 404 None
DEBUG:urllib3.connectionpool:https://mirrors.tuna.tsinghua.edu.cn:443 "GET /anaconda/pkgs/free/win-64/current_repodata.json HTTP/1.1" 404 None
DEBUG:urllib3.connectionpool:https://mirrors.tuna.tsinghua.edu.cn:443 "GET /anaconda/cloud/conda-forge/noarch/current_repodata.json HTTP/1.1" 304 0
DEBUG:urllib3.connectionpool:https://mirrors.tuna.tsinghua.edu.cn:443 "GET /anaconda/pkgs/free/noarch/current_repodata.json HTTP/1.1" 404 None
DEBUG:urllib3.connectionpool:https://mirrors.tuna.tsinghua.edu.cn:443 "GET /anaconda/cloud/msys2/noarch/current_repodata.json HTTP/1.1" 404 None
| DEBUG:urllib3.connectionpool:https://mirrors.tuna.tsinghua.edu.cn:443 "GET /anaconda/pkgs/free/noarch/repodata.json HTTP/1.1" 304 0
DEBUG:urllib3.connectionpool:https://mirrors.tuna.tsinghua.edu.cn:443 "GET /anaconda/cloud/msys2/win-64/repodata.json HTTP/1.1" 304 0
/ DEBUG:urllib3.connectionpool:https://mirrors.tuna.tsinghua.edu.cn:443 "GET /anaconda/pkgs/free/win-64/repodata.json HTTP/1.1" 304 0
- DEBUG:urllib3.connectionpool:https://conda.anaconda.org:443 "GET /pytorch/noarch/current_repodata.json HTTP/1.1" 304 0DEBUG:urllib3.connectionpool:https://repo.anaconda.com:443 "GET /pkgs/msys2/noarch/current_repodata.json HTTP/1.1" 304 0DEBUG:urllib3.connectionpool:https://repo.anaconda.com:443 "GET /pkgs/r/noarch/current_repodata.json HTTP/1.1" 304 0
DEBUG:urllib3.connectionpool:https://repo.anaconda.com:443 "GET /pkgs/r/win-64/current_repodata.json HTTP/1.1" 304 0
\ DEBUG:urllib3.connectionpool:https://mirrors.tuna.tsinghua.edu.cn:443 "GET /anaconda/cloud/msys2/noarch/repodata.json HTTP/1.1" 304 0
| DEBUG:urllib3.connectionpool:https://repo.anaconda.com:443 "GET /pkgs/msys2/win-64/current_repodata.json HTTP/1.1" 304 0
/ DEBUG:urllib3.connectionpool:https://repo.anaconda.com:443 "GET /pkgs/main/win-64/current_repodata.json HTTP/1.1" 304 0
DEBUG:urllib3.connectionpool:https://repo.anaconda.com:443 "GET /pkgs/main/noarch/current_repodata.json HTTP/1.1" 304 0
DEBUG:urllib3.connectionpool:https://conda.anaconda.org:443 "GET /pytorch/win-64/current_repodata.json HTTP/1.1" 304 0

环境信息

D:\0code\vision>conda info

     active environment : GAN
    active env location : C:\Users\lutao\.conda\envs\GAN
            shell level : 2
       user config file : C:\Users\lutao\.condarc
 populated config files : C:\Users\lutao\.condarc
          conda version : 23.7.2
    conda-build version : 3.26.0
         python version : 3.11.4.final.0
       virtual packages : __archspec=1=x86_64
                          __cuda=12.2=0
                          __win=0=0
       base environment : D:\anaconda  (read only)
      conda av data dir : D:\anaconda\etc\conda
  conda av metadata url : None
           channel URLs : https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/win-64
                          https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/noarch
                          https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/win-64
                          https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch
                          https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64
                          https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/noarch
                          https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : D:\anaconda\pkgs
                          C:\Users\lutao\.conda\pkgs
                          C:\Users\lutao\AppData\Local\conda\conda\pkgs
       envs directories : C:\Users\lutao\.conda\envs
                          D:\anaconda\envs
                          C:\Users\lutao\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/23.7.2 requests/2.31.0 CPython/3.11.4 Windows/10 Windows/10.0.19045
          administrator : False
             netrc file : None
           offline mode : False

默认情况下,conda 的日志级别不会显示这么详细的DEBUG信息。可能是你的环境变量中设置了使其显示DEBUG信息。要更改日志级别,可以执行以下命令:

conda config --set log_level warn

这会将日志级别设置为warn,这意味着只有警告和错误信息会被打印出来,减少了日志的冗余信息。

  • 9
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
您好!关于PyTorch安装和报错处理,我可以帮助您解答。首先,您可以按照以下步骤安装PyTorch: 1. 确保已经安装了Python。PyTorch支持Python 3.6及以上版本。 2. 打开命令行终端,使用pip或conda命令安装PyTorch。如果您使用pip,可以运行以下命令: ``` pip install torch torchvision ``` 如果您使用conda,可以运行以下命令: ``` conda install pytorch torchvision -c pytorch ``` 在安装过程中,可能会遇到一些报错。以下是一些常见的报错及其处理方法: 1. 报错信息:`ERROR: Could not find a version that satisfies the requirement torch`。 处理方法:请确保您输入的命令正确,并且网络连接正常。如果网络连接不稳定,可以尝试使用其他源进行安装。 2. 报错信息:`ModuleNotFoundError: No module named 'torch'`。 处理方法:这通常表示PyTorch未成功安装。请检查安装命令是否正确,并尝试重新安装PyTorch。 3. 报错信息:`CUDA out of memory`。 处理方法:这表示您的显存不足以运行当前的模型或数据。您可以尝试减少输入数据的大小,或使用更小的模型。另外,您也可以考虑使用较大的显存或在云平台上运行模型。 4. 报错信息:`ImportError: DLL load failed: The specified module could not be found`。 处理方法:这可能是由于缺少一些依赖库导致的。您可以尝试更新您的操作系统和显卡驱动程序,并重新安装PyTorch。 如果您遇到其他报错,可以提供具体的报错信息,我将尽力帮助您解决问题

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值