1影锈、Anaconda安裝(Linux)
1.1 下載并安裝
打開anaconda官網(wǎng):https://www.anaconda.com/distribution/,復(fù)制文件鏈接(注意下載linux版的找田,是sh后綴)居灯,然后在linux上使用wget下載文件
wget https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh
安裝德挣,一路回車就好了不撑。
sh Anaconda3-2019.10-Linux-x86_64.sh
1.2 conda: command not found
在終端輸入conda info --envs檢驗(yàn)anaconda是否安裝成功臼勉,發(fā)現(xiàn)報(bào)錯(cuò):conda: command not found
原因是因?yàn)閪/.bashrc文件沒有配置好
vim ~/.bashrc
在最后一行加上(注意user_name要替換為你的用戶名)
export PATH=$PATH:/home/user_name/anaconda3/bin
然后保存更改邻吭,運(yùn)行
source ~/.bashrc
2、Anaconda虛擬環(huán)境
2.1 基本命令
列出所有已有環(huán)境
conda env list
創(chuàng)建一個(gè)新的環(huán)境
conda create -n env_name python=version
激活并進(jìn)入環(huán)境中
source activate env_name
退出虛擬環(huán)境
conda deactivate
刪除一個(gè)已有的環(huán)境
conda env remove -n env_name
2.2 安裝第三方庫
2.2.1 從已有環(huán)境安裝
conda批量導(dǎo)出包含環(huán)境中所有組件的requirements.txt文件
conda list -e > requirements.txt
pip導(dǎo)出環(huán)境中所有庫
pip freeze > requestment.txt
conda批量安裝requirements.txt文件中包含的組件依賴
conda install --yes --file requirements.txt
2.2.2 直接安裝
conda install cudatoolkit=9.0
conda install cudnn
pip install ninja tqdm
conda install pytorch torchvision -c pytorch
git clone https://github.com/Tramac/awesome-semantic-segmentation-pytorch.git
cd awesome-semantic-segmentation-pytorch/core/nn
python setup.py build develop
pip install tensorflow-gpu==1.9
conda install pillow
conda install opencv
conda install scipy==1.1.0
conda install numpy==1.16.0
2.2.3 numpy報(bào)錯(cuò)
FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
版本太新宴霸,使用下面命令安裝舊版本即可囱晴。
conda install numpy==1.16.0