阿里云服务器(vgn7i-vws) anaconda(py39)+pytorch1.12.0(cu113)

用xshell连接ip地址,端口号22,输入用户密码

安装anaconda 2022 10 py3.9

wget https://repo.anaconda.com/archive/Anaconda3-2022.10-Linux-x86_64.sh

sha256sum Anaconda3-2022.10-Linux-x86_64.sh #校验数据完整性

chmod u+x Anaconda3-2022.10-Linux-x86_64.sh #添加执行权限

bash Anaconda3-2022.10-Linux-x86_64.sh #执行安装脚本

Do you accept the license terms? [yes|no]

yes

/home/anaconda3

yes

#添加环境变量

vim /etc/profile

i

(末尾)export PATH=/home/develop/anaconda3/bin:$PATH

:wq!

#查看conda版本

conda -V

conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/

conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/

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

conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/

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

conda config --show-sources

查看硬件版本,阿里云vgn7i-vws公共镜像需管理员权限装显卡驱动

lspci | grep -i vga

lspci | grep -i nvidia

安装驱动

sudo apt-get update

apt install ubuntu-drivers-common

ubuntu-drivers devices

sudo ubuntu-drivers autoinstall

查看驱动

nvidia-smi(看到11.4版本)

wget ......cuda11.4.sh

bash cuda11.4.sh

wget ......cudnn-CUDA11.x%28v8.9.3%29.sh

bash cudnn-CUDA11.x\(v8.9.3\).sh

重启生效

reboot

nvcc -V

装pytorch(cu113即可,cuda114向下兼容)

pip install torch==1.12.0+cu113 torchvision==0.13.0+cu113 torchaudio==0.12.0+cu113 -f https://download.pytorch.org/whl/torch_stable.html

python

import torch

torch.version

VSCode连接

用户名@ip地址 [email protected] 不用写端口号

继续/跳过/不再显示

输入密码

相关推荐
张槊哲16 分钟前
如何打包python程序为可执行文件
开发语言·python
张3蜂20 分钟前
Jupyter Notebook 全面介绍:从原理到实战部署
ide·python·jupyter
AI_RSER43 分钟前
基于 Google Earth Engine (GEE) 的土地利用变化监测
python·随机森林·分类·土地利用·gee·遥感影像·landsat
AI小小怪1 小时前
Linux下编译并打包MNN项目迁移至其他设备
linux·opencv·mnn·mtcnn
JhonKI1 小时前
【Linux网络】TCP服务中IOService应用与实现
linux·网络·tcp/ip
uncle_ll1 小时前
FastAPI 零基础入门指南:10 分钟搭建高性能 API
后端·python·微服务·api·fastapi
程序猿与金融与科技1 小时前
PyQt6基础_pyqtgraph_折线图with缩放调节
python·pyqt6·pyqtgraph
guest_8811 小时前
用 Python 打造打篮球字符动画!控制台彩色炫酷输出,抖音搞怪视频灵感还原
开发语言·python·numpy·pillow
qq_447429411 小时前
Linux0.11内存管理:相关代码
linux·c语言
没有不重的名么1 小时前
在Pytorch中使用Tensorboard可视化训练过程
人工智能·pytorch·python