1.install Ubuntu18.04 and update source

Update to mirrors.aliyun.com, reference this in step 1.

2.Deep learning environment

Anaconda3.5.2-py36+cuda10.0+cudnn7.5+pytorch1.1+tensorflow2.0-beta+mxnet

Anaconda
  • download Anaconda3-5.2.0-Linux-x86_64 or other version
  • bash Anaconda3-5.2.0-Linux-x86_64.sh
  • enter yes for adding path to .bashrc, no for install vscode
  • source ~/.bashrc
  • use which pip or which python, you will see default pip or python is now in Anaconda.
  • use conda -V to version of Anaconda
  • add conda mirror follow Anaconda 镜像使用帮助
  • update pip source, mkdir ~/.pip && sudo gedit ~/.pip/pip.conf, then add the following in pip.conf
    1
    2
    3
    [global]
    trusted-host=mirrors.aliyun.com
    index-url=https://mirrors.aliyun.com/pypi/simple/
NVIDIA driver
  • sudo apt purge nvidia-* to remove old driver
  • sudo add-apt-repository ppa:graphics-drivers/ppa to add repository
  • sudo apt update && sudo apt upgrade
  • ubuntu-drivers devices to see driver versions
  • sudo apt install nvidia-driver-410 to install
  • restart and check install nvidia-smi or watch -n 0.1 nvidia-smi
  • use sudo apt-mark hold nvidia-driver-410 to prevent graphics drivers from updating automatically
    However, it may be slow and have some problem, you can download nvidia-driver-410.104 or other version, then install follow this reference to install.
CUDA
  • download cuda_10.0.130_410.48_linux.run or search for other version
  • sudo sh cuda_10.0.130_410.48_linux.run
  • use q to install directly and pay attention not to install NVIDIA Accelerated Graphics Driver, the other’s can use y or default. Details are in reference.
  • add following use sudo gedit ~/.bashrc

    1
    2
    3
    export CUDA_HOME=/usr/local/cuda 
    export PATH=$PATH:$CUDA_HOME/bin
    export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
  • source ~/.bashrc and use nvcc -V to see cuda version

cudnn
  • download cudnn-10.0-linux-x64-v7.5.0.56.solitairetheme8 or other version
  • then
    1
    2
    3
    4
    5
    6
    tar -zxvf cudnn-10.0-linux-x64-v7.5.0.56.solitairetheme8
    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
    sudo chmod a+r /usr/local/cuda/lib64/libcudnn*
    cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2
pytorch
  • see https://pytorch.org/get-started/locally/
  • or use downloaded .whl files

    1
    2
    pip install torch-1.1.0-cp36-cp36m-linux_x86_64.whl
    pip install torchvision-0.3.0-cp36-cp36m-linux_x86_64.whl
  • test install

    1
    2
    3
    4
    5
    In [1]: import torch
    In [2]: torch.__version__
    Out[2]: '1.1.0'
    In [3]: torch.cuda.is_available()
    Out[3]: True
tensorflow2.0-beta
  • install use pip

    1
    2
    pip install tensorflow==2.0.0-beta0  # cpu
    pip install tensorflow-gpu==2.0.0-beta0 # gpu
  • It may have problem ERROR: Cannot uninstall 'wrapt'. Directly use global search to remove related folders and .Egg-info related files. Details are in reference.

  • test install
    1
    2
    3
    4
    5
    In [1]: import tensorflow as tf
    In [2]: tf.__version__
    Out[2]: '2.0.0-beta0'
    In [3]: tf.test.is_gpu_available()
    Out[3]: True
mxnet
1
pip install mxnet-cu100

Applications(some are in reference)

sougou input
WPS
  • download WPS and install directly
minmize when click
1
gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize'
vim & Compression software & support exfat
1
2
3
sudo apt install vim
sudo apt install p7zip-full p7zip-rar rar unzip
sudo apt install exfat-fuse exfat-utils
git
  • add your .ssh to your home and init
    1
    2
    3
    sudo apt-get install git
    git config --global user.name ''
    git config --global user.email
opencv for python
1
2
sudo apt install libopencv-dev
pip install opencv-python
pycharm
  • install in Ubuntu Software
  • or this reference, download pycharm Community version
  • tar -zxvf pycharm-community-{your version}.tar.gz
  • sudo mv pycharm-community-{your version} /opt/
  • sudo gedit /usr/share/applications/pycharm.desktop and add the follows

    1
    2
    3
    4
    5
    6
    7
    8
    [Desktop Entry]
    Version=1.0
    Type=Application
    Name=Pycharm
    Icon=/opt/pycharm-community-2019.1.3/bin/pycharm.png
    Exec=/opt/pycharm-community-2019.1.3/bin/pycharm.sh
    MimeType=application/x-py;
    Name[en_US]=pycharm
  • sudo chmod u+x /usr/share/applications/pycharm.desktop

  • It may have problem No module named 'distutils.core', solve it by
    sudo apt-get install python3-distutils