日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

faster-rcnn中添加Mask中的RoiAlign层,使回归框更精确( roi_align_layer.cu:240] Check failed: error == cudaSuccess *)

發布時間:2024/9/21 编程问答 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 faster-rcnn中添加Mask中的RoiAlign层,使回归框更精确( roi_align_layer.cu:240] Check failed: error == cudaSuccess *) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

版權聲明:本文為博主原創文章,未經博主允許不得轉載。 https://blog.csdn.net/e01528/article/details/80265118

具體的操作為什么這樣做,可參照:

1.Caffe學習之自定義創建新的Layer層

?

2.如何在caffe中自定義網絡層

ROI pooling層

說起ROI Alignment,就要說道faster-rcnn的ROI pooling,

ROIpooling層結構是為了將原圖像的rois映射固定大小的feature map上。而此方法有一些缺點,會帶來邊緣像素的缺失

ROI Pooling層解析

ROI Align的作用

詳解 ROI Align 的基本原理和實現細節

如果roi大小為(7,6),而roipooling是分成了(6,6)的部分,(7,6)到(6,6)的轉換必然帶來了邊緣某像素的損失。而roialign利用雙線性插值,將roi(7,6)插值擴充到(12,12),此時再做(6,6)的roipooling,會提高精度,充分利用了roi的像素。

用到的文件鏈接: https://pan.baidu.com/s/1-f98btUdxX5h8bFTKRxLmA 密碼: mypk

1.~/py-faster-rcnn/caffe-fast-rcnn/include/caffe/layers 添加roi_align_layer.hpp

2.~/py-faster-rcnn/caffe-fast-rcnn/src/caffe/layers 添加roi_align_layer.cpp roi_align_layer.cu

3.~/py-faster-rcnn/caffe-fast-rcnn/src/caffe/protocaffe.proto添加add for roi align以下的

  • // Message that stores parameters used by ROIPoolingLayer

  • 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];

  • ?
  • // add for roi align

  • optional float pad_ratio = 4[default = 0];

  • optional uint32 bi_type = 5 [default = 0];

  • optional bool is_multi_interpolate = 6 [default = true];

  • ?

    4.返回caffe-fast-rcnn路徑下 make clean ,make -j64,make pycaffe

    5.修改model文件夾下面的prototxt模型文件,將ROIPooling換成ROIAlign

    ?

    ---------------------------------------- ???? 更新與2018年5月16日???? --------------------------------------

    如果你電腦出現下面這樣的問題

    roi_align_layer.cu:240] Check failed: error == cudaSuccess (7 vs. 0) too many resources requested for launch

    ?

    【解決方法】:

    1. 刪除 roi_align_layer.cu文件

    2. 打開roi_align_layer.hpp文件注釋掉需要gpu加速的語句.(如下圖)

    3. 重新編譯 make clean ,make -j64,make pycaffe

    注意:如果不注釋hpp的那一段,直接刪除cu文件,重新編譯會報錯

    --------------------- 本文來自 Snoopy_Dream 的CSDN 博客 ,全文地址請點擊:https://blog.csdn.net/e01528/article/details/80265118?utm_source=copy

    總結

    以上是生活随笔為你收集整理的faster-rcnn中添加Mask中的RoiAlign层,使回归框更精确( roi_align_layer.cu:240] Check failed: error == cudaSuccess *)的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。