• 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参数有问题.

  • 相关阅读:
    switch多分枝语句
    自动扫描判断数组奇偶 直接在控制台输入
    if else语句
    1231作业
    字符集和字符编码
    12.28作业
    置顶广告
    图片库
    js实现隔行换色及其鼠标滑过变色
    【转载】display:inline-block兼容ie6/7的写法
  • 原文地址:https://www.cnblogs.com/gongxijun/p/6672797.html
Copyright © 2020-2023  润新知