如何配置深度學習系統

  • 2019 年 12 月 18 日
  • 筆記

Anacodna相關操作

下載安裝以及切換鏡像

#下載和安裝anaconda  wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-5.2.0-Linux-x86_64.sh  bash Anaconda3-5.2.0-Linux-x86_64.sh    #切換到清華源,加快下載速度  wget https://tuna.moe/oh-my-tuna/oh-my-tuna.py  python oh-my-tuna.py

conda環境創建、退出和移除

conda create --name py36 python=3.6 #創建環境  conda activate py36 #激活環境  conda deactivate py36 #退出環境  conda remove --name py36 --all #刪除環境  conda info -e #查看系統中的所有環境

conda查找包的所有版本

conda search tensorflow

conda瘦身

conda clean -p      //刪除沒有用的包  conda clean -t      //清理tar

查看系統內存和進程

#安裝系統查看器  pip install glances

運行glances查看系統狀態

深度學習環境創建

注意不需要手動配置cuda和cudnn,直接conda安裝

TF環境

1.x推薦1.14.0版本

conda install tensorflow-gpu==1.14.0  #conda install tensorflow-gpu //默認是2.0版本  conda install keras

Torch環境

conda install pytorch torchvision cudatoolkit=10.0

在線安裝失敗

有可能因為網絡原因下載失敗,因此可以先下載然後本地安裝,tf和torch也類似

cuda和cudnn安裝

wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/linux-64/cudnn-7.3.1-cuda10.0_0.tar.bz2  conda install cudnn-7.3.1-cuda10.0_0.tar.bz2 #本地安裝  wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/linux-64/cudatoolkit-10.0.130-0.tar.bz2  conda install cudatoolkit-10.0.130-0.tar.bz2 #本地安裝

pytorch gpu版本

wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/linux-64/pytorch-1.3.0-py3.6_cuda10.0.130_cudnn7.6.3_0.tar.bz2  conda install pytorch-1.3.0-py3.6_cuda10.0.130_cudnn7.6.3_0.tar.bz2

從頭配置centos服務器環境

參考這篇 博客