Nvidia DIGITS Learning Notes (nvidia DIGITS-2.0 + Ubuntu 14.04 + CUDA 7.0 + CuDNN 7.0 + Caffe 0.13.0)

Source: Internet
Author: User
Tags dnn theano nvidia digits

NVIDIA DIGITS-2.0 + Ubuntu 14.04 + CUDA 7.0 + CuDNN 7.0 + Caffe 0.13.0 Environment configuration

    • Introduction
      • Digits Introduction
      • Digits characteristics
      • Resource information
      • Description
    • Digits installation
      • Hardware and Software Environment
        • Hardware environment
        • Software Environment
      • Operating system Installation
      • Digits Pre-Installation preparation
        • Install Cuda70deb mode
        • Installing cuDNN70
        • Installing Caffe-0130
      • Installing digits
      • Start digits
      • Configure digits
    • Using digits
      • Digits official self-bringing example mnist
        • Download Mnist Data Set
        • To create a dataset on digits server
        • Create a deep network model on digits server and train
          • A little problem cudnn
        • Use digits server for classification operations mnist
    • Conclusion

Introduction Digits Profile

The Digits:deep learning GPU Training System1, the first interactive deep learning GPU training system developed by NVIDIA Corporation. The aim is to integrate existing deep learning development tools to simplify the design, training and visualization of depth neural networks (neural network,dnn). Digits is a browser-based interface, so the optimal DNN can be quickly designed by visualizing real-time network behavior. Digits is open source software that can be found on GitHub, so developers can extend and customize digits.

Digits characteristics
    • Provides a friendly user interface, complete Dnns training with just a simple click. Digits is a Web application, accessed by a browser, is a typical work flow chart.

    • The digits user interface provides DNN optimization tools. The main console lists the existing databases and the previously trained network models available on the machine, as well as ongoing training activities.

    • Digits makes visualizing networks and fast contrast accuracy easy. You select a model, digits shows the training status and accuracy, and provides options for loading and classifying images when the network is training or when training is complete.

    • Because digits runs on a Web server, team users can easily share database and network configurations, as well as test and share results.

    • The digits integrates the popular Caffe deep learning framework and supports GPU acceleration using CUDNN.

Resource information
    1. Search in Baidu: NVIDIA DIGITS
    2. Software Home (DIGITS): https://developer.nvidia.com/digits
    3. hardware platform (NVIDIA-Built environment) DIGITS? Devbox):
      Https://developer.nvidia.com/devbox
    4. Related documents :
      Http://docs.nvidia.com/deeplearning/index.html#axzz3juAVWoDb

Login to the software homepage, after registration to download digits (note that the registered mailbox click on the activation link), you can also download the source (based on Python) installation.

References :

    1. DIGITS 2 supports multi-GPU auto-scaling for deep learning performance multiplier, Source link: GPU Powered deeplearning with NVIDIA DIGITS on EC2

    2. Deep learning on EC2: CUDA 7/cudnn/caffe/digits Practical Tutorial, original link: GPU Powered deeplearning with NVIDIA DIGITS on EC2

Description
    1. As stated by the official, digits now only supports Ubuntu and, of course, has been tested successfully on other Linux systems and has not seen cases configured on Windows;
    2. Digits attempts to include more open-source deep learning frameworks, and currently (digits-2.0) only includes: Caffe, Torch, Theano, and Bidmach.
Digits installation

Installation instructions, the official website said digits installation is quite convenient: 1) Visit digits home page to register and download the installer installation, or 2) get the source code installation from GitHub. In fact, for the novice is not the case, the following describes the use of the source code installation method.

Note 1: I will use the source code installed software installation root directory is: /home/liu/sfw , that is ~/sfw , this article is recorded as Yourpath. The installation path for this caffe: /home/liu/sfw/caffe , digits installation path: /home/liu/sfw/digits ; cuda default installation root directory is /usr/local .

Illustration 2: The installation method of each software can view the online help of the official website, but also can view the documents in the source code. For the latter, most of the ". MD" is the markdown file, which can be installed Retext view, such as the Caffe "installation.md" file for previewing.

Hardware environment of software and hardware environment

Notebook x1, CPU (Intel? The Core? i5-3210m CPU @ 2.50ghzx4) x1, GPU (GeForce GT 635m/pcie/sse2 + IntelGMAHD3000) x1.

Software Environment

Environment Introduction and DOWNLOAD Link:

    1. operating system : Ubuntu 14.04 LTS bit (ubuntu-14.04.3-desktop-amd64.iso)
    2. cuda: CUDA-7.0 (cuda-repo-ubuntu1404-7-0-local_7.0-28_amd64.deb), Cuda-enabled GPU
    3. CuDNN: cuDNN-7.0 (cudnn-7.0-linux-x64-v3.0-rc.tgz)
    4. Caffe: Caffe-0.13.0 (Caffe-master.zip)
    5. DIGITS: DIGITS-2.0 (source installation, Digits-master.zip)
Operating system Installation

Specific installation methods see: USB drive System disk production and system installation (detailed illustrations).

Digits Pre-Installation preparation

Use the source code before installing digits, prior to install CUDA(must),CuDNN(for GPU acceleration, recommended installation),Caffe(run digits to have at least a deep learning The framework, you can also install Theano, not described here).

Install CUDA7.0 (". Deb" mode)

1. Download the installation file : You can directly access the above given the official website link download, you can also enter the following command in the terminal window to download.

# downloading the (currently) most recent version of CUDA 7sudo wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_7.0.28_amd64.deb

2. Install the dependent tool : Need to connect the network.

# installation of required toolssudo apt-get install -y gcc g++ gfortran build-essential   git wget linux-image-generic libopenblas-dev python-dev   python-pip python-nose python-numpy python-scipy

3. Cuda Installation:

# installing CUDAsudo cuda-repo-ubuntu1404-7-0-local_7.0-28_amd64.debsudo apt-get updatesudo apt-get install cuda

4. Set Environment variables :
Mode 1, modify only user variables

# setting the environment variables so CUDA will be foundecho-e"\nexport CUDA_HOME=/usr/local/cuda" >> ~/.bashrcecho-e"\nexport LD_LIBRARY_PATH=$CUDA_HOME/lib64:$LD_LIBRARY_PATH" >> ~/.bashrc

Mode 2, modify all user variables
Use the sudo gedit /etc/profile open profile file First,
Then, at the end of the open profile file, add the following code and save :

# setting the environment variables so CUDA will be found# After open profile, Add follow code at the end of fileexport CUDA_HOME="/usr/local/cuda"export LD_LIBRARY_PATH="$CUDA_HOME/lib64:$LD_LIBRARY_PATH"

5. load a new environment variable: After adding the environment variable, the new environment variable needs to be loaded before it can be applied to the system.

Restart sudo reboot , or load update environment variable source ~/.bashrc (mode 1), source /etc/profile (Mode 2).

6. Install the samples and check the CPU: Samples is installed by default /home/liu :

# installing the samples and checking the GPUcuda-install-samples-7.0.sh ~/cd NVIDIA_CUDA-7.0_Samples/1_Utilities/deviceQuerymake  ./deviceQuery

The above process, the terminal did not give the error message, it proves that Cuda installation is successful.

Installing cuDNN7.0

The installation of the CUDNN is simple:

1. Unzip : Go to "cudnn-7.0-linux-x64-v3.0-rc.tgz" directory, unzip the file as follows:

#注意修改成你的目录cd /home/liu/sfw#解压-d cudnn-7.0-linux-x64-v3.0-rc.tgztar xf cudnn-7.0-linux-x64-v3.0-rc.tar

2.copy file to cuda installation directory : After decompression, in your directory to generate a "Cuda" folder, for cuDNN6.5 version of the extract after the "cudnn-6.5-linux-x64-v2" file. Use the following command to copy

# copy the library files into CUDA‘s include and lib folderssudo cp cuda/include/cudnn.h /usr/local/cuda/includesudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64

CUDNN installation is complete.

Installing Caffe-0.13.0

Installation method of official website: http://caffe.berkeleyvision.org/installation.html.

After downloading the Caffe-0.13.0, unzip the file caffe-master.zip generate "Caffe-master" folder, and rename it to "Caffe", placed under the yourpath root directory, such as: /home/liu/sfw .

1. first install some dependent libraries : CUDA (Installed), BLAS, Boost, OpenCV and so on, see the official Website installation method: http://caffe.berkeleyvision.org/ Installation.html, or the Readme file (INSTALLATION.MD).

sudo apt-get install libprotobuf-dev libleveldb-dev   libsnappy-dev libopencv-dev libboost-all-dev libhdf5-serial-dev   libgflags-dev libgoogle-glog-dev liblmdb-dev protobuf-compiler   libatlas-base-dev

2. install additional dependent libraries : To view the "Requirements.txt" file, be careful to replace the following path with your path.

cd ~/sfw/caffe/pythonforindosudo$reqdone

2. modify the configuration file and compile : The terminal enters the "Caffe" folder, copies a copy of the Makefile.config file, and then modifies the Makefile.config file, such as an annotation that can be removed without using #GPU_ONLY=1 the GPU: # , Make your own changes as needed, with default values and no modifications. Then compile:

cd ~/sfw/caffecp Makefile.config.example Makefile.config# for a faster build, compile in parallel by doing make all -j8 where 8 is the number of parallel threads for compilation (a good choice for the number of threads is the number of cores in your machine).make allmake pymake testmake runtest

Compilation time is long, you can use multi-threading, you need to know the number of threads of your computer, the following will be much faster:

make all -j4  make py -j4make test -j4  make runtest -j4

There are no error prompts in the compilation, the instructions are correct.

3. Add environment variable : Method with Cuda (Install CUDA7.0 (". Deb" mode), but the environment variable name and path need to change, such as:

# Add environmentecho-e"\nexport CAFFE_HOME=/home/liu/sfw/caffe" >> ~/.bashrc# load the new environmental variablessource ~/.bashrc

Or:

# Add environmentsudo gedit /etc/profile# After open profile, Add follow code at the end# Set Caffe environmentexport CAFFE_HOME="/home/liu/sfw/caffe"# load the new environmental variablessource /etc/profile

So the Caffe is ready to install!

Installing digits

1. Unzip the file : Finally can install DIGITS, unzip the downloaded Digits-master.zip file to generate "Digits-master" folder, rename it to "DIGITS", and copy to your directory Yourpath, such as/HOME/LIU/SFW below.

2. Install digits: The command is as follows, note the path modification.

cd /home/liu/sfw/digitssudo apt-get install graphviz gunicornforindosudo$reqdone
Start digits

Go to the Digits folder, give the file "./digits-devserver" the executable permission, and then ./digits-devserver run the digits:

cd ~/sfw/digitschmod +x ./digits-devserver./digits-devserver

The runtime may prompt for a failure to start : $ImportError:/usr/lib/liblapack.so.3:undefined SYMBOL:ATL_CHEMV

In StackOverflow found the reason and the solution, the command is as follows:

sudo apt-get remove libopenblas-base

Then at the terminal input ./digits-devserver , you can start successfully:

The long-lost interface finally came out:

Configure digits

The above step is to start digits by default configuration, if you want to customize the configuration, you can enter it before starting:

set silently by default. If you need more control over your configuration, try one of these commands:# Set more options before starting the server./digits-devserver --config# Advanced usagepython -m digits.config.edit --verbose
Use Digitsdigits official self-bring example (MNIST)

See the "gettingstarted.md" file in the gettingstarted or source package.

Download Mnist Data Set

Digits provides the tools to download Datasets Mnist and Cifar, in the /digits/tools/download_data directory containing the following files:

Execute the main.py program in which you can:

The main code is as follows:

#首次使用赋予执行权限chmod +x *.py#查看帮助./main.py -h#创建一个目录用于存放MNIST数据集mkdir -p /home/liu/sfw/digits/data/mnist#下载数据集至上述目录./main.py -c mnist ~/sfw/digits/data/mnist

After execution, you can see the downloaded datasets in the /digits/data/mnist directory, such as:

To create a dataset on digits server

Here, as described in the "gettingstarted.md" file, create the dataset as a categorical dataset: Click Images in the DataSets area of the Digits Server home page, select Classfication, In the popup window fill in the training data set information, here is 60,000 samples ("GETTINGSTARTED.MD" Example sample number is 10k), information see:

Data Set creation process:

Click "DIGITS" in the upper-left corner to return to the created Mnist train 60k DataSet:

Create a deep network model on digits server and train

For example, click Images in the Models area and select Classfication. In the popup page fill in the information, data set selection: MNIST train 60k, model named: LeNet on MNIST 60k, such as:

When you click on the blue button "Create", the task will start executing!

A small problem (CuDNN)

I thought I was excited to see the result, but disappointed, and reported the error:

ERRORCheck failed: status == CUDNN_STATUS_SUCCESS (6 vs. 0) CUDNN_STATUS_ARCH_MISMATCH

Such as:

In fact, when the installation of Caffe, when the operation of a make runtest small problem, reported the "Check failure", but let me directly ignored, did not expect to come back, haha.

This is because the computational power of gt635m on a laptop is 2.1, and the official CUDNN acceleration is not supported by 3.0, so you can only comment out the USE_CUDNN line in Makefile.config and re-execute the following compilation 2.

make clean  make all -j4  make test -j4  make runtest -j4

Note : Visit Cuda GPUs to view the computing power of the GPU, select the GPU models on the page, such as the GeForce GT 635M, such as:

After compiling, delete the previously built letnet on MNIST 60k task, then copy the above steps, re-create a new task, after execution, such as:

The running process, the training state of the network, the status of the GPU, etc. are displayed in real time:

The relationship between learning rate and training algebra

Using digits server for classification operations (MNIST)

After training, you can classify handwritten digital images, classify individual images, or classify multiple images at the same time, as an example of the validation set in the "MNIST train 60k" dataset generated in the above steps.

In the Upload Image list area, click the 选择文件 button and select the List file for the validation set Val.txt:

After selecting, click the Classify Many Images button, you can classify multiple images, at this time, the interface does not show progress, displayed in the terminal, such as:

After the selected image classification is complete, the category results page pops up:

Visual Classification Results:

Conclusion

This document documents the installation of my Nvidia DIGITS steps and methods, the software environment for Ubuntu 14.04 + CUDA 7.0 + CuDNN 7.0 + Caffe 0.13.0 + DIGITS 2.0. As an example, the use of digits is briefly described in the digits Readme file.

Can be seen, digits source installation method is still a certain difficulty, especially for Linux unfamiliar users. Digits is easy to use, simple click operation, you can complete the creation of data sets, network model creation, network training, real-time display of network training status, with the training of the network for image classification tasks, so that people unfamiliar with deep learning can also be in the deep learning of the sea easy to sail, The purpose of this formal digits design.

Digits in addition to support Caffe, but also support Theano, this article does not introduce Theano, but will continue to add, about Theano some information, can also be found in my other blogs.

    • Introduction
      • Digits Introduction
      • Digits characteristics
      • Resource information
      • Description
    • Digits installation
      • Hardware and Software Environment
        • Hardware environment
        • Software Environment
      • Operating system Installation
      • Digits Pre-Installation preparation
        • Install Cuda70deb mode
        • Installing cuDNN70
        • Installing Caffe-0130
      • Installing digits
      • Start digits
      • Configure digits
    • Using digits
      • Digits official self-bringing example mnist
        • Download Mnist Data Set
        • To create a dataset on digits server
        • Create a deep network model on digits server and train
          • A little problem cudnn
        • Use digits server for classification operations mnist
    • Conclusion

    1. http://devblogs.nvidia.com/parallelforall/digits-deep-learning-gpu-training-system/?
    2. http://blog.csdn.net/songyu0120/article/details/43233907?

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Nvidia DIGITS Learning Notes (nvidia DIGITS-2.0 + Ubuntu 14.04 + CUDA 7.0 + CuDNN 7.0 + Caffe 0.13.0)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.