Skip to content

neverrop/Deep-learning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

Deep-learning

environment installation for DL

Ubuntu (Mac)

Tips for terminal

sudo apt-get install dconf-cli
wget -O gogh https://git.io/vQgMr && chmod +x gogh && ./gogh && rm gogh
# chalk(22), ocean dark
apt-get install git zsh curl
sh -c "$(curl -fsSL https://github.com/raw/robbyrussell/oh-my-zsh/master/tools/install.sh)"

vi ~/.zshrc
ZSH_THEME=agnoster
DEFAULT_USER=$USER
# or
prompt_context() {}
chsh -s $(which zsh)  # change shell to zsh for user
if passwd needed:
Changing /etc/pam.d/chsh: from:
auth       required   pam_shells.so
to
auth       sufficient   pam_shells.so
sudo apt-get install fonts-powerline
brew cask install qlcolorcode qlstephen qlmarkdown quicklook-json qlimagesize suspicious-package quicklookase qlvideo
 sudo apt-get install silversearcher-ag
 for mac:
 brew install the_silver_searcher
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh}/plugins/zsh-autosuggestions

plugins=(zsh-autosuggestions) 
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh}/plugins/zsh-syntax-highlighting
plugins=(zsh-syntax-highlighting)
source ~/.zshrc
sudo apt-get install autojump

. /usr/share/autojump/autojump.sh
#add this to ~/.zshrc
sudo apt update
sudo apt install python3-dev python3-pip python-dev python-pip
sudo pip3 install thefuck
brew install thefuck  # OSX

Others

pip install tldr

sshpass

brew install https://github.com/raw/kadwanev/bigboybrew/master/Library/Formula/sshpass.rb

Environment for Deep learning

CUDA and drivers

  1. Download CUDA , cuda 9.1[ tensorflow only support cuda 8 ]

  2. Remove any other installation (sudo apt-get purge nvidia-cuda* - if you want to install the drivers too, then sudo apt-get purge nvidia-*.)

  3. sudo sh cuda7.5.18linux.run --override
    

    If cannot install graphic driver.

    1. if error: It appears that an X server is running:

      enter non-GUI mode (tty1,.eg.)

      sudo service lightdm stop
      
    2. if LC_ALL warning

      echo "export LC_ALL="en_US.UTF-8"" >> ~/.zshrc
      
    3. install Nvidia driver manually

      lspci | grep -i nvidia  # check the gpu device
      

      Download the right driver version

      sudo add-apt-repository ppa:graphics-drivers/ppa
      sudo apt update
      sudo apt-get install nvidia-*

      If failed due to kernel issues, it might due to the wrong gcc version.

      Use 'gcc -v' to check gcc version.

      install the right gcc version needed

      sudo update-alternatives --config gcc  # switch gcc version
      
  4. Add path to ~/.zshrc or ~/.bashrc

    echo "export PATH=$PATH:/usr/local/cuda-8.0/bin
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-8.0/lib64" >> ~/.zshrc
  5. Verify CUDA installation

    nvcc --version 
    nvidia-smi

CUDNN

  1. Download cudnn:

    1. cudnn8
    2. cudnn9
  2. Unzip the cuDNN package.

    tar -xvf cudnn-9.0-linux-x64-v7.tar
  3. Copy the following files into the CUDA Toolkit directory.

    sudo cp cuda/include/cudnn.h /usr/local/cuda/include
    sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64
    sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*

Anoconda

  1. Download the installer:

  2. In your Terminal window, run:

    bash Anaconda-latest-Linux-x86_64.sh
  3. add path

    echo "# added by Anaconda3 installer
    export PATH="/home/never/anaconda3/bin:$PATH"" >> ~/.zshrc
conda install pytorch torchvision -c pytorch
  1. Follow the instructions on the Anaconda download site to download and install Anaconda.

  2. Create a conda environment named tensorflow to run a version of Python by invoking the following command:

    $ conda create -n tf python=3.6
    
  3. Activate the conda environment by issuing the following command:

    $ source activate tf
     (tf)$  # Your prompt should change 
    
  4. Issue a command of the following format to install TensorFlow inside your conda environment: (cuda9.0)

    sudo ln -s /usr/local/cuda/lib64/libcudnn.so.7.0.4 /usr/local/cuda/lib64/libcudnn.so.6pip install --ignore-installed --upgrade \ https://github.com/mind/wheels/releases/download/tf1.4-gpu-cuda9/tensorflow-1.4.0-cp36-cp36m-linux_x86_64.whl
    
  5. MKL

    # If you don't have cmake
    sudo apt install cmake
    
    git clone https://github.com/01org/mkl-dnn.git
    cd mkl-dnn/scripts && ./prepare_mkl.sh && cd ..
    mkdir -p build && cd build && cmake .. && make
    sudo make install
    
    echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib' >> ~/.bashrc
  6. Verification

    if import tensorflow —> error: *.so.8.0 not found

    for i in *so.9.1;do
    for> sudo ln -s $i ${i/%9.1/9.0}
    for> done

📚 Author : never

📅 Date : 2018.3.1

📧 Contact : zbh@ut-vision.org

About

environment installation for DL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages