ubuntu16.04配置py-faster-rcnn(CPU版)
来源:互联网 发布:投资网络电影赚钱吗 编辑:程序博客网 时间:2024/05/16 00:28
Caffe配置:
采用http://blog.csdn.net/u013989576/article/details/56677749配置好caffe
py-faster-rcnn配置:
1、下载py-faster-rcnn源码
git clone --recursive https://github.com/rbgirshick/py-faster-rcnn.git
2、安装cython、easydict
sudo pip install cython sudo pip install easydict
3、编译cython:修改py-faster-rcnn/lib下的setup.py文件,注释掉GPU的相关代码,然后make,修改如下:
#CUDA = locate_cuda() #self.set_executable('compiler_so', CUDA['nvcc']) #Extension('nms.gpu_nms', #['nms/nms_kernel.cu', 'nms/gpu_nms.pyx'], #library_dirs=[CUDA['lib64']], #libraries=['cudart'], #language='c++', #runtime_library_dirs=[CUDA['lib64']], # this syntax is specific to this build system # we're only going to use certain compiler args with nvcc and not with # gcc the implementation of this trick is in customize_compiler() below #extra_compile_args={'gcc': ["-Wno-unused-function"], # 'nvcc': ['-arch=sm_35', # '--ptxas-options=-v', # '-c', # '--compiler-options', # "'-fPIC'"]}, #include_dirs = [numpy_include, CUDA['include']] #),
make
4、编译caffe:修改py-faster-rcnn/caffe-fast-rcnn下的Makefile.config文件和CMakeLists.txt文件,对于Makefile.config文件的修改,和caffe配置中的修改一样,对于CMakeLists.txt文件,将OFF改成ON,即:
caffe_option(CPU_ONLY "Build Caffe without CUDA support" ON) # TODO: rename to USE_CUDA
cd ~/py-faster-rcnn/caffe-fast-rcnn make -j8&& make pycaffe
5、测试demo
5.1 下载训练好的模型
cd ~/py-faster-rcnn ./data/scripts/fetch_faster_rcnn_models.sh有的时候下载不下来,我们可以点击链接下载,再放到py-faster-rcnn/data下。
5.2 进行如下修改:
A 修改py-faster-rcnn/lib/fast-rcnn下的config.py文件,即:__C.USE_GPU_NMS = False
B 修改py-faster-rcnn/tools下的test_net.py、train_net.py文件,将caffe.set_mode_gpu() 改为caffe.set_mode_cpu()
C 修改py-faster-rcnn/lib/fast-rcnn下的nms_wrapper.py文件,即:
#from nms.gpu_nms import gpu_nms
def nms(dets, thresh, force_cpu= True)
5.3 运行demo
cd ~/py-faster-rcnn ./tools/demo.py --cpu
但是CPU速度比较慢,而且容易内存溢出,所以我们可以使用ZF模型(默认为VGG16):
cd ~/py-faster-rcnn ./tools/demo.py --cpu --net zf
阅读全文
0 0
- ubuntu16.04配置py-faster-rcnn(CPU版)
- ubuntu16.04配置py-faster-rcnn
- ubuntu14.04安装CPU版caffe以及py-faster-rcnn
- py-faster-rcnn配置运行demo.py(Ubuntu14.04)
- ubuntu16.04+caffe安装和 py-faster-rcnn的CPU安装
- Ubuntu16.04+caffe的安装和Py-faster-rcnn在CPU电脑的安装-2
- py-faster-rcnn配置CPU下运行demo.py
- ubuntu16.04+py-faster-rcnn+ZF运行demo.py
- py-faster-rcnn配置
- Ubuntu16.04 cuda8.0 cudnn v5.1 caffe py-faster-rcnn配置
- py-faster-rcnn配置过程(ubuntu)
- py-faster-rcnn+cpu配置并训练自己的数据
- Ubuntu16.04配置运行faster rcnn
- Ubuntu16.04+GT720M + Cuda8.0+py-faster-rcnn(caffe)
- Ubuntu16.04 + cudnn5.0 + py-faster-rcnn + gpu
- ubuntu16.04下py-faster-rcnn安裝
- ubuntu14.04在cpu上配置caffe以及py-faster-rcnn环境(可在odroid上实现)
- ubuntu14.04、CPU的py-faster-rcnn安装步骤
- 友好城市
- HD6019MG loves gold
- Q&A——内存管理(一)
- php基础(一)
- Q&A——资源管理(一)
- ubuntu16.04配置py-faster-rcnn(CPU版)
- 技术-Java连接mysql数据库
- 对于2-gram 条件下对英语文本的分词处理
- 【网易】双核处理
- T_FINISH
- 11、vue.js 之路由
- SparkSQL写数据到Hive的动态分区表
- Q&A——资源加载(一)
- Tecplot宏的循环结构