环境安装

conda环境安装

  1. 访问网址:Download Anaconda Distribution,填写邮箱,点击提交,复制下载链接。
  2. 在Linux上输入wget https://xxxx.sh,进行下载
  3. 下载过后,输入bash Anaconda3_xxx.sh
  4. 会有个命令行界面提供安装指南,阅读许可,按Enter阅读,然后输入yes接受条款,选择安装位置。
  5. 问你是否初始化,选择yes。

创建环境

  1. 输入conda info -e
  2. 输入conda create -n py310 python=3.10
  3. 输入conda activate py310

安装pytorch

  1. 安装cuda驱动,有nvidia-msi
  2. 驱动和cuda toolkit版本对应:CUDA 12.5 Update 1 Release Notes (nvidia.com)
    CUDA Toolkit 12.5 Update 1 Downloads | NVIDIA Developer
  3. 下面有个Archive of Previous CUDA Releases,点击可跳转查找历史版本。
  4. 安装cuda toolkit,有nvcc -V,
    安装cudnn,(这个好像不需要单独装,安装pytorch过程中会自动安装这个)
  5. 过程中如果需要换源:
    mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
    wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo

杂项问题解决

修改DNS

vim /etc/resolv.conf
# 添加:nameserver 114.114.114.114

pip install安装包添加代理

pip install --proxy=http://192.168.2.168:7890 torch_xxx.whl

点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部