working environment
Graphics: GPU system: the Ubuntu 16.04 . . 5 the LTS CUDA: 10.0 the Python: . 3 .x
1. Create conda environment
Download the official website: https://www.anaconda.com/distribution/#download-section
Download the appropriate installation file, then run.
1 cd init 2 sudo wget https://repo.anaconda.com/archive/Anaconda3-2019.03-MacOSX-x86_64.pkg 3 bash Anaconda3-2019.03-Linux-x86_64.sh
The prompts, and select the installation directory, the default installation at ~ / anaconda3 / directory.
Note: initialization
1, if the default is not initialized, after installation, no conda command, you need to manually initialize
installation finished.
Do you wish the installer to initialize Anaconda3
by running conda init? [yes|no]
[no] >>>
You have chosen to not have conda modify your shell scripts at all.
To activate conda's base environment in your current shell session:
eval "$(/home/cortex/anaconda3/bin/conda shell.YOUR_SHELL_NAME hook)"
To install conda's shell functions for easier access, first activate, then:
Conda init
If you'd prefer that conda's base environment not be activated on startup,
set the auto_activate_base parameter to false:
conda config --set auto_activate_base false
Thank you for installing Anaconda3!
===========================================================================
Anaconda and JetBrains are working together to bring you Anaconda-powered
environments tightly integrated in the PyCharm IDE.
PyCharm for Anaconda is available at:
https://www.anaconda.com/pycharm
2、如果选择初始化,则会修改~/.bashrc文件,并创建conda命令
installation finished. Do you wish the installer to initialize Anaconda3 by running conda init? [yes|no] "deeplearning" 105L, 3558C written installation finished. Do you wish the installer to initialize Anaconda3 by running conda init? [yes|no] [no] >>> yes WARNING: The conda.compat module is deprecated and will be removed in a future release. no change /home/cortex/anaconda3/condabin/conda no change /home/cortex/anaconda3/bin/conda no change /home/cortex/anaconda3/bin/conda-env no change /home/cortex/anaconda3/bin/activate no change /home/cortex/anaconda3/bin/deactivate no change /home/cortex/anaconda3/etc/profile.d/conda.sh no change /home/cortex/anaconda3/etc/fish/conf.d/conda.fish no change /home/cortex/anaconda3/shell/condabin/Conda.psm1 no change /home/cortex/anaconda3/shell/condabin/conda-hook.ps1 no change /home/cortex/anaconda3/lib/python3.7/site-packages/xonsh/conda.xsh no change /home/cortex/anaconda3/etc/profile.d/conda.csh modified /home/cortex/.bashrc ==> For changes to take effect, close and re-open your current shell. <== If you'd prefer that conda's base environment not be activated on startup, set the auto_activate_base parameter to false: conda config --set auto_activate_base false Thank you for installing Anaconda3! =========================================================================== Anaconda and JetBrains are working together to bring you Anaconda-powered environments tightly integrated in the PyCharm IDE. PyCharm for Anaconda is available at: https://www.anaconda.com/pycharm
Exit conda environment
1 conda deactivate
2. Go conda py3.6
1 conda create -n py36 python=3.6 2 conda activate py36
3. Install the necessary packet
# Tsinghua modified source pip
1 mkdir ~/.pip 2 touch ~/.pip/pip.conf
# Pip.conf writes the following
[global] index-url = https://pypi.tuna.tsinghua.edu.cn/simple
Installation package
1 pip install numpy==1.16.2 2 pip install opencv-python==4.1.0.25 3 pip install keras==2.1.4 4 pip install tensorflow-gpu==1.13.1
4. Installation nccl2
Download: https://docs.nvidia.com/deeplearning/sdk/nccl-install-guide/index.html
The system and corresponding version at cuda nccl2
. 1 the sudo dpkg -i-ubuntu1604- the repo NCCL- 2.4 . . 7 -ga-cuda10.0_1- 1_amd64.deb 2 the sudo APT the Add-Key / var / NCCL-repo- 2.4 . . 7 -ga-cuda10. 0 / 7fa2af80.pub (the prompts) . 3 the sudo APT Update . 4 the sudo APT the install libnccl2 = 2.4 . . 7 - . 1 . + cuda10 0 libnccl-dev = 2.4 . . 7 - . 1 . + cuda10 0
5. Installation openmpi
Download: https://www.open-mpi.org/faq/?category=building#easy-build
1 sudo wget https://download.open-mpi.org/release/open-mpi/v4.0/openmpi-4.0.1.tar.gz 2 gunzip -c openmpi-4.0.1.tar.gz | tar xf - 3 cd openmpi-4.0.1/ 4 sudo ./configure --prefix=/usr/local 5 sudo make all install
6. Install horovod
Document Description: https://github.com/horovod/horovod/blob/master/docs/gpus.md
1 HOROVOD_GPU_ALLREDUCE=NCCL pip install --no-cache-dir horovod
Installation issues that may arise:
1、ImportError: libcudnn.so.7: cannot open shared object file: No such file or directory
Depending on the version, download the corresponding file: https://developer.nvidia.com/rdp/cudnn-download
1 sudo dpkg -i libcudnn7_7.6.0.64-1+cuda10.0_amd64.deb 2 sudo dpkg -i libcudnn7-dev_7.6.0.64-1+cuda10.0_amd64.deb