阿里云服务器安装anaconda和pytorch

阿里云服务器安装anaconda

为了跑代码,租了轻量级的服务器。

安装anaconda

远程连接服务器
在这里插入图片描述先安装bzip2,否则后面会报错

然后安装anaconda
bash Anaconda3-5.3.1-Linux-x86_64.sh -u

一直enter,yes就可

source /root/.bashrc

然后输入python
若调用的是python3,则跳过下面一步
若调用的依旧为python2
在这里插入图片描述
在这里插入图片描述

安装torch

创建pytorch环境
在这里插入图片描述
激活
报错在这里插入图片描述
输入
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/

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

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/peterjc123/

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

然后安装

​conda install pytorch-cpu=0.3.1

​conda install torchvision-cpu

测试
在这里插入图片描述

参考:https://blog.csdn.net/Cinderella___/article/details/88097679

  • 3
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值