win10 新环境中安装pytorch

win10系统,在conda环境中其中一个已经安装了pytorch,现在我想创建一个新环境,在新环境里再安装一个.

下面是过程 把.condarc文件设置

.condarc
ssl_verify: true
channels:
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
  
conda create -n bloomEnviroment python=3.8

activate bloomEnviroment

安装Pytorch 1.7.1 GPU 版本,cu就是cuda的版本指定这个就好安装GPU版本
pip install -U torch==1.7.1+cu101 torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/ --ignore-installed

第二次安装方法,

好久没装不上,折腾了几个小时

这个网址老是拒绝访问https://download.pytorch.org

安装步奏

1.去这个网址选择要下载的torch版本 ,用浏览器下载下来

其中

cu 代表GPU版本

cp表示 python版本要求

https://download.pytorch.org/whl/torch_stable.html

2. 把这个包也下载下来 用浏览器 https://download.pytorch.org/whl/typing-extensions/

把这两个下载号的包放到D盘根目录,在用cmd进行安装

3.先安装这个包 typing_extensions-4.4.0-py3-none-any.whl

pip install typing_extensions-4.4.0-py3-none-any.whl -i https://download.pytorch.org/whl/torch/ --trusted-host download.pytorch.org
  1. 再安装 pytorch包

pip install torch-1.13.1+cu117-cp310-cp310-win_amd64.whl -i https://download.pytorch.org/whl/torch/ --trusted-host download.pytorch.org

就成功了

猜你喜欢

转载自blog.csdn.net/u013628121/article/details/129222585