Python3.9安装torch、mvcc |
您所在的位置:网站首页 › anaconda只有38 › Python3.9安装torch、mvcc |
Python3.9安装torch、mvcc对应版本清单: torchvision-0.14.0+cu117-cp39-cp39-win_amd64.whl torch-1.13.0+cu117-cp39-cp39-win_amd64.whl torchaudio-0.13.0+cu117-cp39-cp39-win_amd64.whl mmcv-full==1.7.0 下面安装教程适用于解决torch.cuda.is_available()返回false解决办法:重装torch 打开cmd输入 python import torch print(torch.__version__)运行结果:1.7.1+cpu 呵呵,恭喜你中招了!我也是在参考https://www.bilibili.com/video/bv1Rz411e7eJ的评论区才发现的。那么如果你的CUDA,cuDNN版本都对,只有Pytorch安装成了CPU的,那么先对它进行卸载,然后再安装 卸载方法: 找到刚才下载成功的三个东西,如果没在虚拟环境下下载Pytorch的话,他们在你的anaconda目录下的lib->site-packages,例如我的在D:\anaconda\Lib\site-packages,删除torch和torch-1.1.1+cpu.dist.info(torch-1.7.1+cu101.dist-info中的+ c u 101 表 示 C U D A 10.1 , + c p u 表 示 C P U 版 本 \color{red}+cu101表示CUDA10.1,+cpu表示CPU版本+cu101表示CUDA10.1,+cpu表示CPU版本) 方法2: 打开pip后面的网页,对.whl文件直接进行下载https://download.pytorch.org/whl/torch_stable.html 在cmd中运行 pip install 路径/torchvision-0.14.0+cu117-cp39-cp39-win_amd64.whl pip install 路径/torch-1.13.0+cu117-cp39-cp39-win_amd64.whl pip install 路径/torchaudio-0.13.0+cu117-cp39-cp39-win_amd64.whl依次输入这三句检验是否成功 python import torch torch.cuda.is_available()版本参考:https://github.com/pytorch/vision/blob/main/README.rst 同理检查是否正常工作,依次输入这三句 python import torch torch.cuda.is_available()结果返回True 安装mmcv-full pip install -U openmim mim install mmcv-full==1.7.0 (如果此步失败,则查看是否打开了v2rayN等配置而导致安装失败) 原文链接:https://blog.csdn.net/qq_46126258/article/details/112708781 |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |