编译 Faster Rcnn
来源:互联网 发布:mac cosmetics美国官网 编辑:程序博客网 时间:2024/05/22 16:23
编译 Faster Rcnn
Rcnn 是比较经典的做目标检测的算法,今天准备学习一下,啥都不用说,先把程序调通。
- 一、编译caffe
编译caffe是最麻烦的事情。。
首先下载rcnn 的代码git clone --recursive https://github.com/rbgirshick/py-faster-rcnn.git
然后开始编译cd /home/mmt/Desktop/py-faster-rcnn/libmake
编译caffecd /home/mmt/Desktop/py-faster-rcnn/caffe-fast-rcnncp Makefile.config.example Makefile.config 然后修改里面的内容WITH_PYTHON_LAYER := 1 USE_CUDNN := 1将这两句前面的 # 号去掉然后make -j8 && make pycaffe
出现错误1src/caffe/net.cpp:8:18: fatal error: hdf5.h: No such file or directory解决方法:将Makefile.config中的INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/includeLIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib修改为:INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serialLIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnumake将 Makefile中LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_hl hdf5修改为:LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_serial_hl hdf5_serial重新编译:make -j8 && make pycaffe 出现错误2 error: too few arguments to function ‘cudnnStatus_t cudnnSetPooling2dDescriptor(cudnnPoolingDescriptor_t, cudnnPoolingMod解决方法:将BVLC(https://github.com/BVLC/caffe)中的下列文件copy 到相应的文件夹,即将这三个文件夹里的cudnn开头的文件全部换成新的:./include/caffe/util/cudnn.hpp./include/caffe/layers/cudnn_conv_layer.hpp./include/caffe/layers/cudnn_relu_layer.hpp./include/caffe/layers/cudnn_sigmoid_layer.hpp./include/caffe/layers/cudnn_tanh_layer.hpp./src/caffe/layers/cudnn_conv_layer.cpp./src/caffe/layers/cudnn_conv_layer.cu./src/caffe/layers/cudnn_relu_layer.cpp./src/caffe/layers/cudnn_relu_layer.cu./src/caffe/layers/cudnn_sigmoid_layer.cpp./src/caffe/layers/cudnn_sigmoid_layer.cu./src/caffe/layers/cudnn_tanh_layer.cpp./src/caffe/layers/cudnn_tanh_layer.cumake cleanmake -j8出现build_release/lib/libcaffe.so:对‘cv::imdecode(cv::_InputArray const&, int)’未定义的引用对于各种cv出错:解决方法:修改Makefile:LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_serial_hl hdf5_serial matio opencv_core opencv_highgui opencv_imgproc opencv_imgcodecs下次编译之前要 make cleanmake clean make -j8编译成功make pycaffepython/caffe/_caffe.cpp:11:31: fatal error: numpy/arrayobject.h: No such file or directory解决方法:然后对照 Makefile.config将第二行加一个localPYTHON_INCLUDE := /usr/include/python2.7 \/usr/local/lib/python2.7/dist-packages/numpy/core/include重新编译成功
- 二、下载models
./data/scripts/fetch_faster_rcnn_models.sh
然后 跑一个demo
./tools/demo.py
编译到此就成功了。
- 三、训练 Fast RCNN 出错
1、在网络初始化到loss_bbox层时会出现smoothL1loss.cpperror :bottom.size=4(3vs.4) If weightsare used, must specify both inside and outside weights之类错误!
解决方法:参考 http://blog.csdn.net/qq_34220460/article/details/72778714找到SmoothL1loss.cpp,找到出错误的那部分看到has_weights=(bottom.size()>=3);把它改成has_weights=(bottom.size()==3);然后下面的if语句用//注释掉。接着还要改,看到下面的这几行代码: CHECK_EQ(bottom[0]->channels(),bottom[3]->channels()); CHECK_EQ(bottom[0]->height(), bottom[3]->height()); CHECK_EQ(bottom[0]->width(), bottom[3]->width());这三行,也要用//注释掉。Ok!!!!!再重新编译!!!!make clean make -j8
2、AttributeError: ‘module’ object has no attribute ‘text_format’
解决方法:参考网址 http://blog.csdn.net/qq_33202928/article/details/72526710
解决办法1:sudo pip install protobuf==2.5.0解决办法2:在文件./lib/fast_rcnn/train.py增加一行import google.protobuf.text_format 即可解决问题
3、TypeError: ‘numpy.float64’ object cannot be interpreted as an index
参考网址:http://m.blog.csdn.net/hongbin_xu/article/details/77278329
阅读全文
0 0
- faster-rcnn 编译问题
- faster-rcnn 安装编译
- 编译 Faster Rcnn
- Windows下faster-rcnn编译
- 编译py-faster-rcnn全过程
- windows下编译py-faster-rcnn
- 编译 cudnn5.0+faster rcnn遇到
- 编译rbgirshick的py-faster-rcnn
- Windows+VS2015编译caffe+py-faster-rcnn
- Ubuntu 编译安装faster rcnn(matlab)
- Windows+VS2015编译caffe+py-faster-rcnn
- Faster rcnn
- Faster-rcnn
- Faster rcnn
- Faster-Rcnn
- faster-rcnn
- faster-RCNN
- Faster-RCNN
- 算法导论20.2-6
- JDBI -- 简介
- 逻辑回归的MATLAB实现(二分类问题)
- Tensorflow辅助工具篇——tensorflow slim(TF-Slim)介绍
- tomcat闪退
- 编译 Faster Rcnn
- 生成对抗网络DCGAN+Tensorflow代码学习笔记(一)----main.py
- 域名注册和域名解析
- Android Jni 利用transpose()和flip()函数实现图像旋转90°
- jQuery ajax请求错误返回status 0和错误error的问题
- 关于ICE传输文件大小的限制跟踪
- The Accomodation of Students (着色法)
- 原型模式
- [leetcode]#58. Length of Last Word