pytorch 环境配置
阅读原文时间:2023年07月10日阅读:2

一.下载Anaconda

二.添加清华镜像

# 添加清华镜像
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/

添加pytorch镜像

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/

for legacy win-64

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/peterjc123/
conda config --set show_channel_urls yes

如果添加不成功或者其他bug,建议在C盘下找到.condarc.txt文件,输入如下配置

channels:

3. 创建新的conda虚拟环境

conda create --name pytorch python=3.7

激活 进入新环境

activate pytorch

4.安装pytorch(注意版本对应)

找到相匹配的cuda版本填如下面 cudatoolkit=

conda install pytorch torchvision cudatoolkit=??

手机扫一扫

移动阅读更方便

阿里云服务器
腾讯云服务器
七牛云服务器

你可能感兴趣的文章