faster rcnn windows配置过程

本文档提供Faster R-CNN环境搭建步骤及解决方案,涵盖AttributeError、KeyError等错误处理,缺少文件“stdbool.h”的解决办法,以及安装依赖模块的方法。同时介绍如何添加定制层到Caffe框架并完成编译。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

https://blog.youkuaiyun.com/u010548772/article/details/79071524

问题1.AttributeError: ‘ProposalLayer’ object has no attribute ‘param_str_’

         param_str_为param_str

问题2:KeyError: ‘1’

        cfg_key = ‘TEST’#str(self.phase)

问题3:faster rcnn 无法打开包括文件:“stdbool.h”

https://bbs.youkuaiyun.com/topics/392191281

         .\Anaconda2\Lib\distutils\msvc9compiler.py
         Locate to line 304: VERSION = get_build_version()
         replace it with : VERSION = 14.0

         注:Install VCForPython27.msi 的方法是无效的,这个问题产生的原因就是因为找不到编译器

               SET VS90COMNTOOLS=%VS140COMNTOOLS%也是无效的

https://blog.youkuaiyun.com/yi452873250/article/details/73848640   这个网址内容比较多

https://blog.youkuaiyun.com/zhangzm0128/article/details/71698880

问题4: no module named

pip install cython
pip install easydict
pip install pyyaml
pip install python-opencv

问题5:_caffe错误

1)添加层和文件

打开py-faster-rcnn\caffe-fast-rcnn\src\caffe\layers文件夹,找到4个文件分别为

   然后copy到你新的caffe的对应文件夹caffe\src\caffe\layers里。

   接着我们添加头文件,打开py-faster-rcnn\caffe-fast-rcnn\include\caffe,把fast_rcnn_layers.hpp这文件copy到caffe的对应文件夹下caffe\include\caffe。

2)配置2个新层

    打开你的caffe\src\caffe\proto下的caffe.proto,进行编辑。

在407行左右

往原来的文件里添加新的层的配置信息

  optional ROIPoolingParameter roi_pooling_param = 8266711;
  optional SmoothL1LossParameter smooth_l1_loss_param = 8266712;
message ROIPoolingParameter {
  // Pad, kernel size, and stride are all given as a single value for equal
  // dimensions in height and width or as Y, X pairs.
  optional uint32 pooled_h = 1 [default = 0]; // The pooled output height
  optional uint32 pooled_w = 2 [default = 0]; // The pooled output width
  // Multiplicative spatial scale factor to translate ROI coords from their
  // input scale to the scale used when pooling
  optional float spatial_scale = 3 [default = 1];
}
message SmoothL1LossParameter {
  // SmoothL1Loss(x) =
  //   0.5 * (sigma * x) ** 2    -- if x < 1.0 / sigma / sigma
  //   |x| - 0.5 / sigma / sigma -- otherwise
  optional float sigma = 1 [default = 1];
}

再重新编译,编译完成后,把caffe-windows\Build\x64\Release\pycaffe\caffe 替换到py-faster-rcnn\caffe-fast-rcnn的python

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值