Giter Site home page Giter Site logo

huaze555 / windows-caffe-faster-rcnn Goto Github PK

View Code? Open in Web Editor NEW
89.0 6.0 93.0 51.04 MB

windows faster rcnn c++ version. joint train

License: Other

CMake 1.74% Makefile 0.44% C 1.74% C++ 53.90% Cuda 35.33% MATLAB 0.62% Python 5.77% Batchfile 0.09% Shell 0.32% PowerShell 0.01% Dockerfile 0.04%

windows-caffe-faster-rcnn's People

Contributors

huaze555 avatar yiran-thu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

windows-caffe-faster-rcnn's Issues

How to train FRCNN using multi-GPU?

大佬,您好,我按照你给的说明,并参考 happynear 的Caffe-windows的第三方库进行相应的配置,脱离NuGet,在vs2015 cuda10.2环境下编译成功。

单gpu VGG16训练没问题,但是多GPU训练时就出现]错误,麻烦您有空能够指导一下,谢谢!
2020-11-24_124626

Vector of Images

¿Have you tried with a version of the C++ interface that feeds the network with a vector of images ( and input_shape with dim >1 in the test.proto)?. It would be great to have it.

无法解析的外部符号 cblas_*

你好,感谢你开源FRCNN的C++代码。
我在使用过程中遇到了一些问题,努力排查了一天仍一无所获,希望您能指点一二,谢谢!

System information (version)

  • Operating System / Platform => Windows 10 64 Bit
  • Compiler => Visual Studio 2013 release X64
Detailed description

在将Register.h和主页的代码加入VS2013的解决方案时,报以下错误:
1
(主页代码中, Mat frame = imread("1.jpg); //image ,少打了个引号,我添加了。)
尝试过用同学电脑上完美运行的Openblas库,以及各种修改示例代码和头文件,均没有解决这个问题。
编译阶段就出错,估计是什么地方的include问题。

Steps to reproduce

我在编译之前已安装好CUDA8和CUDNN5,caffe的CommonSettings.props是这么设置的:

My CommonSettings.props. ```
    <BuildDir>$(SolutionDir)..\Build</BuildDir>
    <!--NOTE: CpuOnlyBuild and UseCuDNN flags can't be set at the same time.-->
    <CpuOnlyBuild>false</CpuOnlyBuild>
    <UseCuDNN>true</UseCuDNN>
    <CudaVersion>8.0</CudaVersion>
    <!-- NOTE: If Python support is enabled, PythonDir (below) needs to be
     set to the root of your Python installation. If your Python installation
     does not contain debug libraries, debug build will not work. -->
    <PythonSupport>false</PythonSupport>
    <!-- NOTE: If Matlab support is enabled, MatlabDir (below) needs to be
     set to the root of your Matlab installation. -->
    <MatlabSupport>false</MatlabSupport>
    <CudaDependencies></CudaDependencies>

    <!-- Set CUDA architecture suitable for your GPU.
     Setting proper architecture is important to mimize your run and compile time. -->
    <CudaArchitecture>compute_35,sm_35;compute_52,sm_52;compute_61,sm_61</CudaArchitecture>

    <!-- CuDNN 4 and 5 are supported -->
    <CuDnnPath></CuDnnPath>
    <ScriptsDir>$(SolutionDir)\scripts</ScriptsDir>
</PropertyGroup>
<PropertyGroup Condition="'$(CpuOnlyBuild)'=='false'">
    <CudaDependencies>cublas.lib;cuda.lib;curand.lib;cudart.lib</CudaDependencies>
</PropertyGroup>

<PropertyGroup Condition="'$(UseCuDNN)'=='true'">
    <CudaDependencies>cudnn.lib;$(CudaDependencies)</CudaDependencies>
</PropertyGroup>
<PropertyGroup Condition="'$(UseCuDNN)'=='true' And $(CuDnnPath)!=''">
    <LibraryPath>$(CuDnnPath)\cuda\lib\x64;$(LibraryPath)</LibraryPath>
    <IncludePath>$(CuDnnPath)\cuda\include;$(IncludePath)</IncludePath>
</PropertyGroup>

<PropertyGroup>
    <OutDir>$(BuildDir)\$(Platform)\$(Configuration)\</OutDir>
    <IntDir>$(BuildDir)\Int\$(ProjectName)\$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup>
    <LibraryPath>$(OutDir);$(CUDA_PATH)\lib\$(Platform);$(LibraryPath)</LibraryPath>
    <IncludePath>$(SolutionDir)..\include;$(SolutionDir)..\include\caffe\proto;$(CUDA_PATH)\include;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(PythonSupport)'=='true'">
    <PythonDir>C:\Miniconda2\</PythonDir>
    <LibraryPath>$(PythonDir)\libs;$(LibraryPath)</LibraryPath>
    <IncludePath>$(PythonDir)\include;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(MatlabSupport)'=='true'">
    <MatlabDir>C:\Program Files\MATLAB\R2014b</MatlabDir>
    <LibraryPath>$(MatlabDir)\extern\lib\win64\microsoft;$(LibraryPath)</LibraryPath>
    <IncludePath>$(MatlabDir)\extern\include;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(CpuOnlyBuild)'=='true'">
    <ClCompile>
        <PreprocessorDefinitions>CPU_ONLY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
    </ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(UseCuDNN)'=='true'">
    <ClCompile>
        <PreprocessorDefinitions>USE_CUDNN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
    </ClCompile>
    <CudaCompile>
        <Defines>USE_CUDNN</Defines>
    </CudaCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(PythonSupport)'=='true'">
    <ClCompile>
        <PreprocessorDefinitions>WITH_PYTHON_LAYER;BOOST_PYTHON_STATIC_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
    </ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(MatlabSupport)'=='true'">
    <ClCompile>
        <PreprocessorDefinitions>MATLAB_MEX_FILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
    </ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup>
    <ClCompile>
        <MinimalRebuild>false</MinimalRebuild>
        <MultiProcessorCompilation>true</MultiProcessorCompilation>
        <PreprocessorDefinitions>_SCL_SECURE_NO_WARNINGS;USE_OPENCV;USE_LEVELDB;USE_LMDB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
        <TreatWarningAsError>true</TreatWarningAsError>
    </ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <ClCompile>
        <Optimization>Full</Optimization>
        <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
        <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
        <FunctionLevelLinking>true</FunctionLevelLinking>
    </ClCompile>
    <Link>
        <EnableCOMDATFolding>true</EnableCOMDATFolding>
        <GenerateDebugInformation>true</GenerateDebugInformation>
        <LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
        <OptimizeReferences>true</OptimizeReferences>
    </Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <ClCompile>
        <Optimization>Disabled</Optimization>
        <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
        <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
    </ClCompile>
    <Link>
        <GenerateDebugInformation>true</GenerateDebugInformation>
    </Link>
</ItemDefinitionGroup>
```
但我并未将CUDA文件都放到Caffe文件夹下。

整个编译过程有警告,无报错。

编译完成后,将caffe和第三方库的相关文件都在VS2013的设置好,运行示例代码,即出现上述错误。

望能帮助解答,谢谢!

测试出现问题

用程序中自带的图进行测试,在python中没有出现cuda out of memory的问题,用C++测试出现这样的问题,必须把test_max_size改为600才能正常运行,但是测试的结果和python中测试得出的结果不一致,请大神给讲解一下

./windows/ 文件夹

你好, ./windows/ 这个文件夹下的 caffe.sln和.vcxproj工程文件,是怎样的到呢? (习惯看带./windows/的源代码,然而有的源代码中没有./windows/文件夹,需要cmake生成caffe.sln。 -----也就是说,怎样能够得到 ./windows/文件夹里面的内容呢)

FRCNNResnet101 无法收敛或是loss_bbox 始终为0

用的models\FRCNN\res101 train_val.proto进行训练
以下是一些训练片段 感觉loss不正常
训练完成后使用test_frcnn.exe, 直接用训练集当做测试集
结果都是 0
详细调试后发现score < 0.8的地方 score 值非常低0.00x最高我看到的也就0.05

I0828 11:53:16.375608 19192 solver.cpp:218] Iteration 19920 (2.24295 iter/s, 8.91684s/20 iters), loss = 1.99799
I0828 11:53:16.375608 19192 solver.cpp:237] Train net output #0: bbox_accuracy = 0.75
I0828 11:53:16.376610 19192 solver.cpp:237] Train net output #1: loss_bbox = 0.430361 (* 1 = 0.430361 loss)
I0828 11:53:16.376610 19192 solver.cpp:237] Train net output #2: loss_cls = 1.27145 (* 1 = 1.27145 loss)
I0828 11:53:16.376610 19192 solver.cpp:237] Train net output #3: rpn_cls_loss = 0.898545 (* 1 = 0.898545 loss)
I0828 11:53:16.376610 19192 solver.cpp:237] Train net output #4: rpn_loss_bbox = 0.391415 (* 1 = 0.391415 loss)
I0828 11:53:16.376610 19192 sgd_solver.cpp:105] Iteration 19920, lr = 0.001
I0828 11:53:25.249524 19192 solver.cpp:218] Iteration 19940 (2.25401 iter/s, 8.87307s/20 iters), loss = 1.99201
I0828 11:53:25.249524 19192 solver.cpp:237] Train net output #0: bbox_accuracy = 0.75
I0828 11:53:25.250700 19192 solver.cpp:237] Train net output #1: loss_bbox = 0.644284 (* 1 = 0.644284 loss)
I0828 11:53:25.250700 19192 solver.cpp:237] Train net output #2: loss_cls = 0.905329 (* 1 = 0.905329 loss)
I0828 11:53:25.250700 19192 solver.cpp:237] Train net output #3: rpn_cls_loss = 0.0850422 (* 1 = 0.0850422 loss)
I0828 11:53:25.250700 19192 solver.cpp:237] Train net output #4: rpn_loss_bbox = 0.0457095 (* 1 = 0.0457095 loss)
I0828 11:53:25.251526 19192 sgd_solver.cpp:105] Iteration 19940, lr = 0.001
I0828 11:53:34.160838 19192 solver.cpp:218] Iteration 19960 (2.24479 iter/s, 8.90953s/20 iters), loss = 2.00955
I0828 11:53:34.160838 19192 solver.cpp:237] Train net output #0: bbox_accuracy = 0.75
I0828 11:53:34.161839 19192 solver.cpp:237] Train net output #1: loss_bbox = 0.721698 (* 1 = 0.721698 loss)
I0828 11:53:34.161839 19192 solver.cpp:237] Train net output #2: loss_cls = 1.35276 (* 1 = 1.35276 loss)
I0828 11:53:34.161839 19192 solver.cpp:237] Train net output #3: rpn_cls_loss = 0.107642 (* 1 = 0.107642 loss)
I0828 11:53:34.161839 19192 solver.cpp:237] Train net output #4: rpn_loss_bbox = 0.0488492 (* 1 = 0.0488492 loss)
I0828 11:53:34.161839 19192 sgd_solver.cpp:105] Iteration 19960, lr = 0.001
I0828 11:53:43.032603 19192 solver.cpp:218] Iteration 19980 (2.25453 iter/s, 8.87101s/20 iters), loss = 1.98453
I0828 11:53:43.032603 19192 solver.cpp:237] Train net output #0: bbox_accuracy = 0.96875
I0828 11:53:43.033603 19192 solver.cpp:237] Train net output #1: loss_bbox = 0.000514256 (* 1 = 0.000514256 loss)
I0828 11:53:43.033603 19192 solver.cpp:237] Train net output #2: loss_cls = 0.411482 (* 1 = 0.411482 loss)
I0828 11:53:43.033603 19192 solver.cpp:237] Train net output #3: rpn_cls_loss = 0.192493 (* 1 = 0.192493 loss)
I0828 11:53:43.033603 19192 solver.cpp:237] Train net output #4: rpn_loss_bbox = 0.0110174 (* 1 = 0.0110174 loss)
I0828 11:53:43.033603 19192 sgd_solver.cpp:105] Iteration 19980, lr = 0.001

查看入口data 处你写死了batch_size大小1 于是我 改动了 voc_config中的batch_size 改为1 后
loss_cls 能正常缩小. 但是loss_bbox的值从第一步就是0.

I0829 14:22:08.621503 712 solver.cpp:218] Iteration 0 (0 iter/s, 2.2033s/20 iters), loss = 3.89008
I0829 14:22:08.621503 712 solver.cpp:237] Train net output #0: bbox_accuracy = 0
I0829 14:22:08.622505 712 solver.cpp:237] Train net output #1: loss_bbox = 0 (* 1 = 0 loss)
I0829 14:22:08.622505 712 solver.cpp:237] Train net output #2: loss_cls = 3.04452 (* 1 = 3.04452 loss)
I0829 14:22:08.622505 712 solver.cpp:237] Train net output #3: rpn_cls_loss = 0.693147 (* 1 = 0.693147 loss)
I0829 14:22:08.622505 712 solver.cpp:237] Train net output #4: rpn_loss_bbox = 0.203805 (* 1 = 0.203805 loss)
I0829 14:22:08.622505 712 sgd_solver.cpp:105] Iteration 0, lr = 0.001
I0829 14:22:23.028703 712 solver.cpp:218] Iteration 20 (1.38832 iter/s, 14.4059s/20 iters), loss = 3.72456
I0829 14:22:23.028703 712 solver.cpp:237] Train net output #0: bbox_accuracy = 1
I0829 14:22:23.029705 712 solver.cpp:237] Train net output #1: loss_bbox = 0 (* 1 = 0 loss)
I0829 14:22:23.029705 712 solver.cpp:237] Train net output #2: loss_cls = 2.81629 (* 1 = 2.81629 loss)
I0829 14:22:23.029705 712 solver.cpp:237] Train net output #3: rpn_cls_loss = 0.68107 (* 1 = 0.68107 loss)
I0829 14:22:23.029705 712 solver.cpp:237] Train net output #4: rpn_loss_bbox = 0.203163 (* 1 = 0.203163 loss)
I0829 14:22:23.029705 712 sgd_solver.cpp:105] Iteration 20, lr = 0.001

请问如何修改才能恢复正常! 谢谢!

vgg1024检测错误

你好,我用py-faster-rcnn训练了自己的vgg1024模型,且demo.py检测ok,但是我试图使用你的C++版本进行检测时却出现如下错误:
[libprotobuf ERROR ..\src\google\protobuf\message_lite.cc:123] Can't parse message of type "caffe.NetParameter" because it is missing required fields: layer[30].psroi_pooling_param.output_dim, layer[30].psroi_pooling_param.group_size
F0224 23:31:12.470517 15296 upgrade_proto.cpp:95] Check failed: ReadProtoFromBinaryFile(param_file, param) Failed to parse NetParameter file: vgg_cnn_m_1024_faster_rcnn_iter_90000.caffemodel
我使用了你提供的vgg1024对应"test.prototxt"和"default_config.json",并修改了其中的n_classes,且default_config.json中的各项参数与python版本一致,多次尝试解决该问题无果。请问能否告知如何解决该问题?盼复!

Unknown layer type: FrcnnRoiData

train_val.protxt文件中输入层的Type为FrcnnRoiData,但caffe.poto中并没有注册这个层,看参数貌似是WindowData,修后会出现Check failed: ExactNumTopBlobs() == top.size() (2 vs. 3) WindowData Layer produces 2 top blob(s) as output的错误,请问您在训练过程中有没有遇到呢?

测试自己的数据遇到的问题

楼主,你好,我打算用test_frcnn测试我自己的数据,模型是在ubuntu下用resnet基础网络训练好的.caffemodel文件,遇到的问题如下:

  1. test_frcnn.bat中的--default_c文件和--image_list文件测试我自己的数据该怎么得到呢?
  2. --out_file得到的结果生成的1.frnn该如何打开?得到的结果只能是在.exe上显示检测出多少个box吗?没办法把检测后有框的图像保存下来吗?

请楼主知道一下,谢谢!

更换数据集重新训练

您好,我想把训练用到的数据集全部还成各种类型的车辆后再训练模型用于检测和分类,用这个工程可以实现吗?

关于ZF模型不能实现目标检测

您好,使用该工程进行VGG16模型可以准确的进行目标检测,同时比之前一个版本的性能提示了很多,但是我在进行ZF模型测试的时候发现使用博主你上一个版本可以对目标物体进行检测,这个版本无法实现目标检测,同时使用的是(windows-caffe-faster-rcnn\models\FRCNN\zf\test.prototxt)目录下的配置文件和,博主你自带的default_config.json只对里面训练的目标种类进行修改

Proposal Layer Merge Invited

Hi! I am so glad to see your work, we launched an organization called UnrealVision, this is a none-profit org. We maintained a caffe version which includes many layers needed by Computer Vision researchers. I'd like invite you join us and merge the proposal_layer needed by faster-rcnn to unreal_caffe if you are interested! Wish get your reply.

From UnrealVision.

mAP计算

你好,非常感谢您能分享代码,想请教下

  1. 程序中是否有mAP的计算;
  2. 在训练过程中的test怎么设置呢,比如比如训练了1000次迭代,要test一次,是不是直接在solver.prototxt中设置参数test_interval呢?
    例如:test_interval: 1000

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.