Skip to content

Instantly share code, notes, and snippets.

@twmht
Last active June 28, 2016 00:01
Show Gist options
  • Select an option

  • Save twmht/5b537ce9dfb4d46d4d72c0e88610f2a1 to your computer and use it in GitHub Desktop.

Select an option

Save twmht/5b537ce9dfb4d46d4d72c0e88610f2a1 to your computer and use it in GitHub Desktop.
Build pyfaster-rcnn in ubuntu 15.04
# for 16.04
# https://github.com/BVLC/caffe/wiki/Ubuntu-16.04-or-15.10-Installation-Guide
# caffe dependencies
sudo 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 libatlas-base-dev
sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev
# Caffe requires the CUDA nvcc compiler to compile its GPU code and CUDA driver for GPU operation.
# To install CUDA, go to the NVIDIA CUDA website and follow installation instructions there.
# Install the library and the latest standalone driver separately;
# the driver bundled with the library is usually out-of-date.
# faster-rcnn
# Make sure to clone with --recursive
git clone --recursive https://github.com/rbgirshick/py-faster-rcnn.git
# Build the Cython modules
cd py-faster-rcnn/lib
make
# troubleshooting
# if you need to switch to gcc version, try the following command
sudo update-alternatives --config gcc
# Build Caffe and pycaffe
cd py-faster-rcnn/caffe-fast-rcnn
cp Makefile.config.example Makefile.config
# Be sure to uncomment WITH_PYTHON_LAYER := 1
make -j8 && make pycaffe
# troubleshooting
# you may have "hdf5.h: No such file or directory" problem when compiling
# if so, try to modify the INCLUDE_DIR in Makefile.config
# INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/
# and create the symbolic link for libhdf5
# cd /usr/lib/x86_64-linux-gnu
# sudo ln -s libhdf5_serial.so.8.0.2 libhdf5.so
# sudo ln -s libhdf5_serial_hl.so.8.0.2 libhdf5_hl.so
# you may have linking error to protobuf and opencv
# it is because that you use gcc-4 and those system-libs are compield with gcc-5
# but CUDA does not support gcc-5 when compiling
# to do so, you need to let cuda pass when compiling with gcc-5
# Modify /usr/local/cuda/include/host_config.h and comment out the following lines
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 9)
#error -- unsupported GNU version! gcc versions later than 4.9 are not supported!
#endif [> __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 9) <]
# download the pretrained models
cd py-faster-rcnn
./data/scripts/fetch_faster_rcnn_models.sh
# run the demo
./tools/demo.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment