This article is synthesized from the Internet and written through its own practice.
0 Preparation
- System settings, change the software source.
- Real-time display of network speed under Ubuntu After installation, run indicator-sysmonitor
1
2
3sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install indicator-netspeed&.Set{net} C: {cpu} M: {mem}
,Check “Run on startup” - Install GDebi to App Store
- Go to Sogou to enter Judge Network to download Sogou input method and use GDebi to install it.
- Netease Cloud Music also provides deb package
- Install git,Install cmake
1
2sudo apt install git
sudo apt install cmake
1 Install Cuda
- Go to System Settings → Software and Updates → Additional Drivers. Install NVIDIA private driver.
- Reboot。Run
sudo nvidia-smi
to check the information that the installation was successful.
- Download the historical version of Cuda from NVIDIA’s official website and download the Cuda8 run file. Be careful not to install drivers again.
- Set environment variables, modify PATH and LD_LIBRARY_PATH Add the last document
1
sudo gedit ~/.bashrc
1
2
3exportPATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}}
exportLD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64\
{LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} - Test CUDA’ samples
1
2
3
4cd /usr/local/cuda-8.0/samples/1_Utilities/deviceQuery
make
sudo ./deviceQuery
PASS,The installation was successful - Install Cudnn
- Official website to download Cudnn: https://developer.nvidia.com/rdp/cudnn-download ,Need to log in.
- Open the terminal in the include directory after extracting cuDNN
1
sudo cp cudnn.h /usr/local/cuda/include/ #Copy header files
- Enter the dynamic file in the lib64 directory to copy and link:
1
2
3
4
5sudo cp lib* /usr/local/cuda/lib64/ #Copy dynamic link library
cd /usr/local/cuda/lib64/
sudo rm -rf libcudnn.so libcudnn.so.5 #Delete the original dynamic file
sudo ln -s libcudnn.so.5.1.10 libcudnn.so.5 #Generate soft links (Note that this corresponds to the cudnn version you downloaded yourself. You can check your version of libcudnn under /usr/local/cuda/lib64)
sudo ln -s libcudnn.so.5 libcudnn.so #Generate soft links
2 Install Caffe
- Download caffe:https://github.com/BVLC/caffe
- Installation dependencies
1
2
3
4
5sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler
sudo apt-get install --no-install-recommends libboost-all-dev
sudo apt-get install libopenblas-dev liblapack-dev libatlas-base-dev
sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev
sudo apt-get install liblapacke-dev checkinstall #This is a dependencie for OpenCV - Extract the caffe package and copy it to the
~/tools
directory - Configuration Makefile.config
- Copy Makefile.config.example,rename Makefile.config
- Modify to
1
2INCLUDE_DIRS := $(PYTHON_INCLUDE)/usr/local/include
LIBRARY_DIRS := $(PYTHON_LIB)/usr/local/lib /usr/lib1
2INCLUDE_DIRS := $(PYTHON_INCLUDE)/usr/local/include /usr/include/hdf5/serial
LIBRARY_DIRS := $(PYTHON_LIB)/usr/local/lib /usr/lib/ usr/lib/x86_64-linux-gnu/ usr/lib/x86_64-linux-gnu/hdf5/serial - Compilation
1
2
3make all –j8
make test
make runtest - Use the MNIST data set to test
- All operations need to be targeted to the caffe root directory
- Download the MNIST database and unzip it
1
./data/mnist/get_mnist.sh
- Convert to Lmdb database format
1
./examples/mnist/create_mnist.sh
- Training network
1
./examples/mnist/train_lenet.sh
- The value of loss and precision can be seen during training, which is 0.9906 in the experiment.
- At this point, caffe installation is complete.
3 Install OpenCV3.2
- Download
- Extract the package and copy it to the
~/tools
directory - Create a new build folder in the OpenCV directory, enter, open the terminal.
- Execute the following command, need networking.
1
sudo cmake -D CMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..
- Compile and install
1
2sudo make –j8 #Need some times
sudo make install - Compile OpenCV under caffe
- Switch to the caffe root directory
- Configure the Makefile.config file and change#OPENCV_VERSION
#OPENCV_VERSION := 3
toOPENCV_VERSION := 3
- Compilation
1
2
3
4make clean #Clear previous compilation
make all -j8
make test
make runtest
#4. Install Matlab
Matlab’s caffe interface is compiled with errors. Continue research.