首先需要新建虚拟环境

conda create –n your_name python=3.6
//这里的yourname是虚拟环境的名字,取什么都可以

激活环境

activate  your_name

添加清华镜像源

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/
conda config --add channels  https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/peterjc123/
conda config --set show_channel_urls yes

安装代码

去官网找安装代码 https://pytorch.org/get-started/previous-versions/
在这里插入图片描述
我的是cuda10.0 只能够装到1.2.0版本的pytorch, 输入安装代码 (把-c pytorch删掉)

//官网的代码
//conda install pytorch==1.2.0 torchvision==0.4.0 cudatoolkit=10.0 -c pytorch
我们要输入的代码
conda install pytorch==1.2.0 torchvision==0.4.0 cudatoolkit=10.0

接着就等待安装结束就可以了

Logo

欢迎来到FlagOS开发社区,这里是一个汇聚了AI开发者、数据科学家、机器学习爱好者以及业界专家的活力平台。我们致力于成为业内领先的Triton技术交流与应用分享的殿堂,为推动人工智能技术的普及与深化应用贡献力量。

更多推荐