win10安装Pytorch【最新版】

由于2019年4月16日和25日清华和中科大分别宣布停止Anaconda镜像服务,因此从2019年5月开始安装Pytorch都会出现一下错误:

CondaHTTPError: HTTP 404 NOT FOUND for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/noarch/repodata.json

由于本人之前的conda源为清华源,因此这里需要使用以下命令先删除清华的源,之后换成上交的源:

conda config --remove channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.sjtug.sjtu.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.sjtug.sjtu.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.sjtug.sjtu.edu.cn/anaconda/cloud/conda-forge/

之后运行安装Pytorch的命令即可,本人电脑为win10+Python3.6+CUDA9.1.85:

conda install pytorch torchvision cudatoolkit=9.0 -c pytorch

安装torchvision的目的为torchvision中主要集成了一些数据集、深度学习模型和一些转换等,torchvision包由三个子包组成,分别是:torchvision.datasets,torchvision.models,torchvision.transforms。

最后安装成功的截图:

win10安装Pytorch【最新版】

测试安装,torch导入没报错,且torch.cuda.is_available()是True就表示支持GPU:

win10安装Pytorch【最新版】

 

posted @ 2019-06-04 14:08 予你心安 阅读(...) 评论(...) 编辑 收藏

相关文章:

  • 2021-11-17
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2021-08-30
  • 2021-11-15
  • 2021-04-02
  • 2021-09-03
猜你喜欢
  • 2021-04-15
  • 2021-08-13
  • 2022-01-06
  • 2021-05-03
  • 2021-06-25
  • 2021-07-29
相关资源
相似解决方案