Anaconda + python3.7 + pytorch-cuda Linux环境搭建

  1. 下载并安装Anaconda;
  2. 创建虚拟环境:conda create -n nlp python=3.7
  3. 切换到nlp虚拟环境:source activate nlp
  4. 为conda添加清华镜像源:
    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 --set show_channel_urls yes
  5. 安装pytorch-cuda:conda install pytorch torchvision cudatoolkit=10.0

你可能感兴趣的:(Anaconda + python3.7 + pytorch-cuda Linux环境搭建)