faster-rcnn在编译时遇到的一些问题

 1.在安装faster-rcnn事如果报这种错误   

In file included from ./include/caffe/util/device_alternate.hpp:40:0,
                 from ./include/caffe/common.hpp:19,
                 from ./include/caffe/blob.hpp:8,
                 from ./include/caffe/net.hpp:10,
                 from ./include/caffe/solver.hpp:7,
                 from ./include/caffe/sgd_solvers.hpp:7,
                 from src/caffe/solvers/adam_solver.cpp:3:
./include/caffe/util/cudnn.hpp: In function ‘const char* cudnnGetErrorString(cudnnStatus_t)’:
./include/caffe/util/cudnn.hpp:21:10: warning: enumeration value ‘CUDNN_STATUS_RUNTIME_PREREQUISITE_MISSING’ not handled in switch [-Wswitch]
   switch (status) {
          ^
./include/caffe/util/cudnn.hpp: In function ‘void caffe::cudnn::setConvolutionDesc(cudnnConvolutionStruct**, cudnnTensorDescriptor_t, cudnnFilterDescriptor_t, int, int, int, int)’:
./include/caffe/util/cudnn.hpp:108:70: error: too few arguments to function ‘cudnnStatus_t cudnnSetConvolution2dDescriptor(cudnnConvolutionDescriptor_t, int, int, int, int, int, int, cudnnConvolutionMode_t, cudnnDataType_t)’
       pad_h, pad_w, stride_h, stride_w, 1, 1, CUDNN_CROSS_CORRELATION));
                                                                      ^

  处理方案:

    这种问题出现的原因是在rbg开源这套物体检查方案时是依据的当时最新的cundnn版本,而这么多年过去,cudnn已经发布了好几个版本,所以要处理这个问题,只需要将caffe框架下的所有cudnn相关的文件替换车成当前caffe最新的即可.

rbg的faster-rcnn模型代码地址: https://github.com/rbgirshick/py-faster-rcnn

cafe框架的代码地址: https://github.com/BVLC/caffe

进入faster-rcnn目录下py-caffe的src/caffe/util/cudnn.cpp 以及src/caffe/layers/cudnn*中的所有文件.还有include/util/cudnn.hpp 和include/layers/cudnn*.hpp中的文件全部替换成caffe中对应的文件.然后编译即可.

2.

python setup.py build_ext --inplace
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 lib64 path could not be located in /usr/lib64
Makefile:2: recipe for target 'all' failed
make: *** [all] Error 1

 这种问题是由于只需要将53行的第二个lib64换成lib即可.

3.安装opencv 

sudo apt-get install python-opencv

 4. 

 File "/home/gxjun/Qunar/py-faster-rcnn/tools/train_faster_rcnn_alt_opt.py", line 67, in get_roidb
    roidb = get_training_roidb(imdb)
  File "/home/gxjun/Qunar/py-faster-rcnn/tools/../lib/fast_rcnn/train.py", line 118, in get_training_roidb
    imdb.append_flipped_images()
  File "/home/gxjun/Qunar/py-faster-rcnn/tools/../lib/datasets/imdb.py", line 111, in append_flipped_images
    assert (boxes[:, 2] >= boxes[:, 0]).all()

这种问题,一般都是清楚缓存,去cache下删除所有文件就可以了

5. 出现问题:训练faster rcnn时出现如下报错:

File "/py-faster-rcnn/tools/../lib/datasets/imdb.py", line 108, in append_flipped_images
    assert (boxes[:, 2] >= boxes[:, 0]).all()
AssertionError
2、问题分析:
检查自己数据发现,左上角坐标(x,y)可能为0,或标定区域溢出图片
其实还存在一种问题,就是图片出现旋转问题.

6.

snapshot_prefix: "vgg16_rpn"
average_loss: 100
I0421 11:53:05.251756 24051 solver.cpp:81] Creating training net from train_net file: models/pascal_voc/VGG16/faster_rcnn_alt_opt/stage1_rpn_train.pt
F0421 11:53:05.251797 24051 io.cpp:36] Check failed: fd != -1 (-1 vs. -1) File not found: models/pascal_voc/VGG16/faster_rcnn_alt_opt/stage1_rpn_train.pt
*** Check failure stack trace: ***

将sovler.txt中的路径设置成绝对路径

7.

 1 Traceback (most recent call last):
 2   File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
 3     self.run()
 4   File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
 5     self._target(*self._args, **self._kwargs)
 6   File "/media/gxjun/78289D37289CF4FA/py-faster-rcnn/tools/train_faster_rcnn_alt_opt.py", line 208, in train_fast_rcnn
 7     max_iters=max_iters)
 8   File "/media/gxjun/78289D37289CF4FA/py-faster-rcnn/tools/../lib/fast_rcnn/train.py", line 160, in train_net
 9     model_paths = sw.train_model(max_iters)
10   File "/media/gxjun/78289D37289CF4FA/py-faster-rcnn/tools/../lib/fast_rcnn/train.py", line 101, in train_model
11     self.solver.step(1)
12   File "/media/gxjun/78289D37289CF4FA/py-faster-rcnn/tools/../lib/roi_data_layer/layer.py", line 144, in forward
13     blobs = self._get_next_minibatch()
14   File "/media/gxjun/78289D37289CF4FA/py-faster-rcnn/tools/../lib/roi_data_layer/layer.py", line 63, in _get_next_minibatch
15     return get_minibatch(minibatch_db, self._num_classes)
16   File "/media/gxjun/78289D37289CF4FA/py-faster-rcnn/tools/../lib/roi_data_layer/minibatch.py", line 55, in get_minibatch
17     num_classes)
18   File "/media/gxjun/78289D37289CF4FA/py-faster-rcnn/tools/../lib/roi_data_layer/minibatch.py", line 125, in _sample_rois
19     roidb['bbox_targets'][keep_inds, :], num_classes)
20   File "/media/gxjun/78289D37289CF4FA/py-faster-rcnn/tools/../lib/roi_data_layer/minibatch.py", line 176, in _get_bbox_regression_labels
21     bbox_targets[ind, start:end] = bbox_target_data[ind, 1:]
22 ValueError: could not broadcast input array from shape (4) into shape (0)

这种问题,一般是model配置参数有问题.需要重新设置protxt中的参数.

8. 

645 net.cpp:408] rpn_cls_prob_reshape -> rpn_cls_prob_reshape
F0810 10:54:11.421221   645 reshape_layer.cpp:80] Check failed: 0 == bottom[0]->count() % explicit_count (0 vs. 58320) bottom count (408240) must be divisible by the product of the specified dimensions (87480)
*** Check failure stack trace: ***

这种问题,一般是看对应的层的参数,比如这里是rpn_cls_prob参数有问题.

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

发表于

我来说两句

0 条评论
登录 后参与评论

相关文章

来自专栏debugeeker的专栏

《coredump问题原理探究》windows版5.1节基本数据类型

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/xuzhina/article/detai...

793
来自专栏逸鹏说道

C# 温故而知新:Stream篇(七)

NetworkStream 目录: NetworkStream的作用 简单介绍下TCP/IP 协议和相关层次 简单说明下 TCP和UDP的区别 简单介绍下套接字...

3015
来自专栏分子生物和分子模拟计算

构象搜索案例(Hyperchem)

4034
来自专栏iOS开发笔记

cordova插件-File Transfer

添加插件 $ cordova plugin addcordova-plugin-file-transfer ? 图 15如上则插入成功 插件的使用 Meth...

36211
来自专栏tkokof 的技术,小趣及杂念

Sweet Snippet系列 之 TCP数据接收

  虽说仍然是Sweet Snippet,不过本篇并没有代码,纯粹是自己觉得有点趣味,就索性一记了~

641
来自专栏一个会写诗的程序员的博客

安装适用于 Java 的 TensorFlow安装适用于 Java 的 TensorFlow

TensorFlow 可提供在 Java 程序中使用的 API。这些 API 特别适合用于加载以 Python 语言创建的模型并在 Java 应用中运行这些模型...

571
来自专栏友弟技术工作室

http digest

HTTP digest 摘要访问认证是一种协议规定的Web服务器用来同网页浏览器进行认证信息协商的方法。它在密码发出前,先对其应用哈希函数,这相对于HTTP基本...

8888
来自专栏运维前线

使用MySQL community 源安装MySQL

使用MySQL community 源安装MySQL 添加MySQL Yum源 下载:http://dev.mysql.com/downloads/repo/y...

2397
来自专栏Seebug漏洞平台

CVE-2015-1641 Word 利用样本分析

00 引 子 本文我们将通过一个恶意文档的分析来理解漏洞 CVE-2015-1641(MS15-033)的具体利用过程,以此还原它在现实攻击中的应用。就目前来...

3318
来自专栏人工智能头条

TensorFlow架构与设计:会话生命周期

1574

扫码关注云+社区