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 Learning Notes (nvidia DIGITS-2.0 + Ubuntu 14.04 + CUDA 7.0 + CuDNN 7.0 + Caffe 0.13.0)

Enjoyyl 2015-09-02 machine learning original link

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
          • Graphics switch
        • 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 caffecudnn
        • 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 multiplication, Source link: Easy multi-gpu deeper learning with DIGITS 2

    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, must be Nvidia's fork, the reason points this)
    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)

CUDA-7.0 installation steps under Linux see the official website manual: Cuda_getting_started_linux, which mentions the installation of ". Run", ". Deb" and other installation files, I chose "Deb" package format, because it is relatively simple.

0. check to see if your computer supports Cuda:
Check whether the GPU supports: Enter the following command if the output GPU model is NVIDIA and is supported in this Http://developer.nvidia.com/cuda-gpus list.

Lspci | Grep-i nvidia

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/re Pos/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 dpkg-i cuda-repo-ubuntu1404-7-0-local_7.0-28_amd64.debsudo apt-get updatesudo apt-get Install Cuda

4. Set Environment variables :

Note: This environment variable is 64-bit system, the 32-bit lib64 conversion can be lib .

Mode 1, modify only user variables

# Setting the environment variables so CUDA'll be Foundecho "\nexport path=/usr/local/cuda-7.0/bin: $PATH" >> ~/.ba Shrcecho "\nexport ld_library_path=/usr/local/cuda-7.0/lib64: $LD _library_path" >> ~/.BASHRC

Mode 2, modify all user variables
First Use sudo gedit /etc/profile open the "profile" file, or sudo gedit ~/.bashrc open the "./BASHRC" file, then add the following code at the end of the open file and save it:

# Setting the environment variables so CUDA'll be found# after open profiles, Add follow code at the end of Fileexport PA Th=/usr/local/cuda-7.0/bin: $PATHexport ld_library_path=/usr/local/cuda-7.0/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.

Load the update environment variable source ~/.bashrc (mode 1), source /etc/profile or source ~/.bashrc (Mode 2).

===== reboot the system! Reboot the System! Reboot the System! =======

sudo reboot

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

After executing ./deviceQuery the command, the terminal output resembles the following information, with GPU model, driver version and running version, computing power ... A lot of information:

This cuda installation was successful. Graphics Switch

If you are using a PC with a dual graphics card, such as a standalone video card of my Intel integrated graphics +nvidia, you can use Nvidia-prime to switch which video card to use. Double-click to /usr/share/applications/NVIDIA X Server Settings start nvidia X Server settings, such as, but not like online says there are nvidia-prime that item:

Then install the nvidia-prime indicator yourself, the command is as follows:

sudo add-apt-repository ppa:nilarimogard/webupd8sudo apt-get updatesudo apt-get install Prime-indicatorsudo reboot

After rebooting the system, you can see the Nvidia or Intel icon in the upper right tray area and click to switch. 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# decompression gzip-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. Copy with the following command, note that the second one has a -a parameter, otherwise the copy of the previous file loses its link.

# Copy the library files into CUDA ' s include and Lib Folderssudo cp Cuda/include/cudnn.h/usr/local/cuda/includesudo Cp-a 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/pythonfor req in $ (cat requirements.txt); Do sudo pip install $req; Done

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 on parallel by doing make ALL-J8 WH  Ere 8 is the number of parallel threads for compilation (a good choice for the number of threads are 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 variable Ssource ~/.BASHRC

Or:

# Add Environmentsudo gedit/etc/profile# after open profiles, add follow code at the end# Set Caffe environmentexport CAFF E_home= "/home/liu/sfw/caffe" # Load the new environmental variablessource/etc/profile

So the Caffe is ready to install! If the make runtest "Core dumped" prompt, the phenomenon and solution see a small problem (CAFFE&CUDNN). 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 gunicornfor req in $ (cat requirements.txt); Do sudo pip install $req; Done

If the network is not good, or the software source service shutdown and so on may cause some dependent libraries can not be downloaded and installed, the terminal will have large red text, please change the software source to confirm the network connection is OK, re-execute the above command. 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 first run prompts you for the installation path for Caffe:

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:

Most values is set silently by default. If you need more control over your configuration, try one of the 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# See Help./main.py-h# create a directory for storing mnist datasets mkdir-p/home/liu/sfw/digits/data/mnist# download datasets to the above directory. 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 (CAFFE&CUDNN)

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

Error:check 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  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
          • Graphics switch
        • 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 caffecudnn
        • Use digits server for classification operations mnist
    • Conclusion
    1. http://devblogs.nvidia.com/parallelforall/digits-deep-learning-gpu-training-system/?
    2. Http://www.voidcn.com/blog/songyu0120/article/p-2424958.html?

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.