Install py-faster-rcnn following the official version
- Build the Cython modules
cd $FRCN_ROOT/lib make
Errors:
Traceback (most recent call last): File "setup.py", line 58, in <module> CUDA = locate_cuda() File "setup.py", line 55, in locate_cuda raise EnvironmentError('The CUDA %s path could not be located in %s' % (k, v)) EnvironmentError: The CUDA lib path could not be located in /usr/local/cuda-8.0/lib
Reason: the cuda path is not correct in ./lib/setup.py
Solver:
gedit 打开 setup.py
cudaconfig = {'home':home, 'nvcc':nvcc, 'include': pjoin(home, 'include'), 'lib': pjoin(home, 'lib')}
把上面的最后一个lib改为lib64即可
cudaconfig = {'home':home, 'nvcc':nvcc, 'include': pjoin(home, 'include'), 'lib': pjoin(home, 'lib64')}
- Build Caffe and pycaffe
cd $FRCN_ROOT/caffe-fast-rcnn # Now follow the Caffe installation instructions here: # http://caffe.berkeleyvision.org/installation.html # If you're experienced with Caffe and have all of the requirements installed # and your Makefile.config in place, then simply do: make -j8 && make pycaffe
Errors:
learning@learning-virtual-machine:~/caffe$ make all
PROTOC src/caffe/proto/caffe.proto
CXX .build_release/src/caffe/proto/caffe.pb.cc
CXX src/caffe/data_transformer.cpp
CXX src/caffe/common.cpp
CXX src/caffe/internal_thread.cpp
CXX src/caffe/blob.cpp
CXX src/caffe/data_reader.cpp
CXX src/caffe/parallel.cpp
CXX src/caffe/util/hdf5.cpp
In file included from src/caffe/util/hdf5.cpp:1:0:
./include/caffe/util/hdf5.hpp:6:18: fatal error: hdf5.h: No such file or directory
compilation terminated.
Makefile:572: recipe for target '.build_release/src/caffe/util/hdf5.o' failed
make: *** [.build_release/src/caffe/util/hdf5.o] Error 1
learning@learning-virtual-machine:~/caffe$
Solver:
Makefile.config INCLUDE_DIRS /usr/include/hdf5/serial/ Makefile LIBRARIES hdf5_hl and hdf5 改为 hdf5_serial_hl ,hdf5_serial
- Demo
cd $FRCN_ROOT ./tools/demo.py
Errors:
Loaded network /home/ubuntu/Projects/py-faster-rcnn/data/faster_rcnn_models/VGG16_faster_rcnn_final.caffemodel Killed
Reason:
The vgg16 model is too large
Solver:
Change to zf model
- Results:
Loaded network /home/ubuntu/Projects/py-faster-rcnn/data/faster_rcnn_models/ZF_faster_rcnn_final.caffemodel ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Demo for data/demo/000456.jpg Detection took 0.530s for 300 object proposals ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Demo for data/demo/000542.jpg Detection took 0.722s for 135 object proposals ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Demo for data/demo/001150.jpg Detection took 0.643s for 231 object proposals ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Demo for data/demo/001763.jpg Detection took 0.764s for 200 object proposals ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Demo for data/demo/004545.jpg Detection took 0.661s for 300 object proposals