huaze555 / windows-caffe-faster-rcnn Goto Github PK
View Code? Open in Web Editor NEWwindows faster rcnn c++ version. joint train
License: Other
windows faster rcnn c++ version. joint train
License: Other
¿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.
你好,感谢你开源FRCNN的C++代码。
我在使用过程中遇到了一些问题,努力排查了一天仍一无所获,希望您能指点一二,谢谢!
在将Register.h和主页的代码加入VS2013的解决方案时,报以下错误:
(主页代码中, Mat frame = imread("1.jpg); //image ,少打了个引号,我添加了。)
尝试过用同学电脑上完美运行的Openblas库,以及各种修改示例代码和头文件,均没有解决这个问题。
编译阶段就出错,估计是什么地方的include问题。
我在编译之前已安装好CUDA8和CUDNN5,caffe的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>
整个编译过程有警告,无报错。
编译完成后,将caffe和第三方库的相关文件都在VS2013的设置好,运行示例代码,即出现上述错误。
望能帮助解答,谢谢!
用程序中自带的图进行测试,在python中没有出现cuda out of memory的问题,用C++测试出现这样的问题,必须把test_max_size改为600才能正常运行,但是测试的结果和python中测试得出的结果不一致,请大神给讲解一下
你好, ./windows/ 这个文件夹下的 caffe.sln和.vcxproj工程文件,是怎样的到呢? (习惯看带./windows/的源代码,然而有的源代码中没有./windows/文件夹,需要cmake生成caffe.sln。 -----也就是说,怎样能够得到 ./windows/文件夹里面的内容呢)
用的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
请问如何修改才能恢复正常! 谢谢!
How to start training the model in visual studio?
你好,我用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版本一致,多次尝试解决该问题无果。请问能否告知如何解决该问题?盼复!
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文件,遇到的问题如下:
请楼主知道一下,谢谢!
您好,我想把训练用到的数据集全部还成各种类型的车辆后再训练模型用于检测和分类,用这个工程可以实现吗?
您好,使用该工程进行VGG16模型可以准确的进行目标检测,同时比之前一个版本的性能提示了很多,但是我在进行ZF模型测试的时候发现使用博主你上一个版本可以对目标物体进行检测,这个版本无法实现目标检测,同时使用的是(windows-caffe-faster-rcnn\models\FRCNN\zf\test.prototxt)目录下的配置文件和,博主你自带的default_config.json只对里面训练的目标种类进行修改
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.
你好,非常感谢您能分享代码,想请教下
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.