使用國內鏡像源安裝pytorch

先設置鏡像源,如清華的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/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

官方安裝的命令是(版本1.4 GPU):

conda install pytorch torchvision cudatoolkit=10.1 -c pytorch

但要用國內源,我發現不能用-c這一段,直接用

conda install pytorch torchvision cudatoolkit=10.1

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章