1、首先下載下傳Anaconda
Anaconda3-5.3.0-Linux-x86_64.sh
解壓:bash +“copy file path的内容”
bash "/home/users/Anaconda3-5.3.0-Linux-x86_64.sh"
2、建立虛拟環境
下述指令建立一個python版本為3.7的虛拟環境,在name處替換為自己的虛拟環境名稱
conda create -n name python=3.7
下述指令可以列出已經建立出來的虛拟環境
conda env list
# 首次使用 source activate 指令激活虛拟環境 my_conda_virutal_environment
source activate my_conda_virutal_environment
# 退出虛拟環境
conda deactivate
# 以後使用 conda activate 指令激活虛拟環境
conda activate my_conda_virutal_environment
4、進入建立的虛拟環境
conda activate name
檢視python版本
5、檢視伺服器CUDA版本
cat /usr/local/cuda/version.txt
6、tensorflow下載下傳
pip install tensorflow-gpu==1.13.1 -i https://pypi.tuna.tsinghua.edu.cn/simple
pip 安裝的時候如果安裝特别慢,可以加上"-i https://pypi.tuna.tsinghua.edu.cn/simple"
7、Keras安裝
pip install keras==2.2.4
pip install keras==2.3.1 -i https://pypi.tuna.tsinghua.edu.cn/simple
8\opencv
pip install opencv-python==4.4.0.42 -i https://pypi.tuna.tsinghua.edu.cn/simple
9、conda list
10、pip install h5py==2.10
11、pip install tqdm
pytorch下載下傳
沒有添加清華鏡像
conda install pytorch==1.1.0 torchvision==0.3.0 cudatoolkit=10.0 -c pytorch(沒有安裝成功)
conda install pytorch torchvision cudatoolkit=10.0 -c pytorch(沒有安裝成功)
添加清華鏡像
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 --set show_channel_urls yes
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda install pytorch torchvision cudatoolkit=10.0(安裝成功,沒有指定pytorch版本,沒有指定torchvision,預設下載下傳)
安裝成功