Fast-rcnn training (1) - installation

Before installing fast-rcnn, you need to install a bunch of configuration files and drivers. Basically, follow the steps below and execute it on the console.

1. Dependency package

sudo apt-get install build-essential  # basic requirement  
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 #required by caffe 
sudo apt-get install --no-install-recommends libboost-all-dev
sudo apt-get install libatlas-base-dev  

2. Install cuda 7.5

The cuda graphics card driver must be installed, otherwise the detection and training speed will be very slow. The
download address is: https://developer.nvidia.com/cuda-downloads
002
According to your system, download the corresponding cuda driver

dpkg -i cuda-repo-ubuntu1404-7-5-local_7.5-18_amd64.deb
apt-get update
apt-get install -y cuda
reboot  //重启电脑

3. Set environment variables

Add the CUDA environment variable in /etc/profile
sudo gedit /etc/profile
add the following two sentences

    PATH=/usr/local/cuda/bin:$PATH  
    export PATH  

After saving, execute the following command to make the environment variable take effect immediately

    source /etc/profile  

At the same time, you need to add the lib library path: Add the file cuda.conf in /etc/ld.so.conf.d/, the content is as follows

/usr/local/cuda/lib64  

After saving, execute the following command to make it take effect immediately

ldconfig  

4. Install CUDA SAMPLE

Go to /usr/local/cuda/samples, execute the following commands to build samples

 make all -j4 

The whole process takes about 10 minutes. After all the compilation is completed, go to samples/bin/x86_64/linux/release and run deviceQuery

./deviceQuery  

If the graphics card information appears, the driver and graphics card are installed successfully

5. Installation of Python library

export CPLUS_INClUDE_PATH=$CPLUS_INCLUDE_PATH:/usr/include/python2.7
export C_INCLUDE_PATH=$C_INCLUDE_PATH:/usr/include/python2.7

apt-get -y install python-numpy
apt-get -y install python-setuptools
easy_install easydict
easy_install leveldb
easy_install snappy
easy_install lmdb
easy_install glog
apt-get -y install python-pip
apt-get install cython
apt-get -y install python-skimage
apt-get -y install python-protobuf

6. Install opencv

https://github.com/jayrambhia/Install-OpenCV

$ cd Ubuntu
$ chmod +x * 
$ ./opencv_latest.sh

7. Fast-rcnn acquisition

This is the author's homepage of fast-rcnn on github https://github.com/rbgirshick/fast-rcnn .
It describes the specific installation steps.
1. Clone this project

git clone --recursive https://github.com/rbgirshick/fast-rcnn.git

First clone the entire project directly.
If you get an error that the git command cannot be found, install git first

2.Build the Cython modules

cd $FRCN_ROOT/lib
make

The $FRCN_ROOT directory here refers to the directory of your fast rcnn
3.Build Caffe and pycaffe

cd $FRCN_ROOT/caffe-fast-rcnn
# 这里要注意一个地方,就是要提前修改makefile.config文件
# WITH_PYTHON_LAYER := 1
# 文件中找到这一行,把这一行前面的注释符号取消,然后再编译
make -j8 && make pycaffe

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325951435&siteId=291194637