Faster R-CNN under CPU only mode using docker
About Faster R-CNN, see _README.md
1. System Info
- Ubuntu 14.04 LTS x64 (I'm using VMWare Fusion)
- Note: Please keep memory >= 4GB, or you may encounter following errors:
g++: internal compiler error: Killed (program cc1plus)
when compiling*ptr host allocation of size 1382400000 failed
when running demo.py
2. Install Docker
- see the official document
- set up usergroup
sudo groupadd docker
sudo gpasswd -a ${USER} docker
sudo service docker restart
3. Pull docker image & Install requirements
- pull docker image
docker pull tleyden5iwx/caffe-cpu-master
- run image
docker run -i -t tleyden5iwx/caffe-cpu-master /bin/bash
- install requirements (cython already satisfied)
sudo apt-get install python-opencv
sudo pip install easydict
- set up git
git config --global user.name "John Doe"
git config --global user.email [email protected]
4. Clone & Run demo
- clone
git clone --recursive https://github.com/shawnau/py-faster-rcnn-cpu.git
- compile(assuming the root of the repo is $FRCN_ROOT)
- rename
$FRCN_ROOT/caffe-fast-rcnn/Makefile.config.example
intoMakefile.config
cd $FRCN_ROOT/lib
make
cd $FRCN_ROOT/caffe-fast-rcnn
git checkout faster-rcnn-upstream-33f2445
make -j8 && make pycaffe
- download pretrained caffemodel
cd $FRCN_ROOT
./data/scripts/fetch_faster_rcnn_models.sh
- run demo
cd $FRCN_ROOT
./tools/demo.py --cpu --net zf
- there is a problem with VGG16 net, may be it's memory's issue, see refer
- results are saved into
tag_<filename>.jpg
under$FRCN_ROOT/data/demo/
5. Main modify
- Problems with the cpu mode
lib/fast_rcnn/config.py
lib/fast_rcnn/nms_wrapper.py
lib/setup.py
tools/test_net.py, train_net.py
caffe-fast-rcnn/Makefile.config
- change output, saving results into files instead of showing
tools/demo.py
Refer
How to setup with CPU ONLY mode
I got the error when running demo.py
Caffe failed with py-faster-rcnn demo.py on TX1