服务器配置环境记录

l参考 https://blog.csdn.net/qq_42845932/article/details/123964867?spm=1001.2014.3001.5502

conda

下载地址:

https://docs.conda.io/en/latest/miniconda.html

修改源:

https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/

参考https://blog.csdn.net/innovationy/article/details/121510666

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
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/cloud/msys2/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --set show_channel_urls yes
完成后输入命令vim ~/.condarc查看配置文件
下图是配置文件内容,按键盘把按键光标移到defaults处,将最后一行defaults删去,否则还会在官方库中寻找。
conda update --all
conda update -n base conda

安装cuda

# conda install cudatoolkit=10.0.0
conda install cudatoolkit=10.0 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/linux-64/

安装cudnn

conda install cudnn=7.6

安装pytorch(https://pytorch.org/get-started/previous-versions/

pip install torch==1.2.0 torchvision==0.4.0

安装完conda以及创建好环境后或者直接安装:
conda install pytorch torchvision torchaudio pytorch-cuda=11.7 -c pytorch -c nvidia
或者用pip3安装,速度更快一些。

验证

import torch
flag = torch.cuda.is_available()
if flag:
    print("CUDA可使用")
else:
    print("CUDA不可用")

挂载

    ln -s /data/xupin/DFUC2022 /home/xupin/dfuc2022
    ln -s /data/xupin/save_weights /home/xupin/dfuc2022

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值