Scripts para configurar automaticamente cudatoolkit=11.1 e torch=1.8.2 no novo ambiente anaconda. A parte comentada abaixo é a configuração do espelho. Se não tiver sido configurado antes, o comentário deve ser descomentado.
# echo "Setting tsinghua and froge mirrors to 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.ustc.edu.cn/anaconda/cloud/conda-forge/
# conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
# conda config --set show_channel_urls yes
echo "Installing cudatoolkit=11.1..."
conda install cudatoolkit=11.1
echo "updating pip and setting mirror..."
pip install pip -U
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
echo "installing torch 1.8.2_cu111 to your env..."
pip3 install torch==1.8.2+cu111 torchvision==0.9.2+cu111 torchaudio==0.8.2 -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html
Como usar: Crie um novo arquivo .sh, copie o código nele e execute-o diretamente no ambiente conda. (Claro, você também pode inseri-lo manualmente, linha por linha)