ubuntu 使用國內源來安裝/卸載 pytorch

一、找到合適的安裝方式

pytorch官網:https://pytorch.org/

å¨è¿éæå¥å¾çæè¿°

二、安裝命令

pip --default-timeout=100 install torch torchvision -i  https://pypi.tuna.tsinghua.edu.cn/simple

或者

conda install pytorch torchvision -c https://pypi.mirrors.ustc.edu.cn/simple

後面的是鏡像,當然也可以採用其他源,網上很多,在這裏不再陳述。或者用以下命令

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

conda install pytorch==1.1.0 torchvision==0.3.0 cudatoolkit=9.0 

三、卸載命令

pip uninstall torch

 

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