Ask Your Question

dnn module caffe, weird output [closed]

asked 2018-11-03 05:48:38 -0500

aguila gravatar image

Hello, i am porting an algorithm to opencv , the models are available here: . I finished the first stage and while implementing the second, the outputs of the network are a bit weird:

Input Data: I: 1 C: 3 H: 24 W: 24

Scores Data: I: 1 C: 2 H: 299777088 W: 1

Regression Data: I: 1 C: 3 H: 309665792 W: 1

Rotate Data: I: 1 C: 3 H: 299780800 W: 1

The channels size of each output is correct, but the H,W are confusing me. I don't know if this has to be with the case that the model is the same for all the three networks?. Or maybe is an overflow issue? I tested it just forwarding a simple image with the secont network "PCN-2.prototxt" the output is similar.. has someone experienced something like this?


edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by dkurt
close date 2018-11-08 06:49:26.640833


porting means what ? to opencv3, using the dnn module instead of caffe ? (that would be indeed cool !)

berak gravatar imageberak ( 2018-11-03 05:53:00 -0500 )edit

yes! using the dnn module instead of caffe, i ported a lot of algorithms and while using the CPU, dnn is faster than the caffe CPU version.. so i wanted to do the same with this one :) .. also the linking is easier Im using the latest repo of opencv..

aguila gravatar imageaguila ( 2018-11-03 05:57:25 -0500 )edit

shame, i don't have caffe, else i'd join your battle ;)

berak gravatar imageberak ( 2018-11-03 06:01:28 -0500 )edit

uuuh shame :( . i will try to figure out what can be different there and post news if i get something. thanks!

aguila gravatar imageaguila ( 2018-11-03 06:24:36 -0500 )edit
sturkmen gravatar imagesturkmen ( 2018-11-03 07:16:35 -0500 )edit

yes, i was looking also in that one. I did the process of setting the inputs and reading the outputs of the networks similarly. Is the first time that I use the same .caffemodel for 3 different networks in opencv::dnn, i dont know if while loading the model, the fact that some output layers have the same name could be an issue (?)

aguila gravatar imageaguila ( 2018-11-03 07:53:33 -0500 )edit
sturkmen gravatar imagesturkmen ( 2018-11-03 07:59:39 -0500 )edit

i have both running in caffe and ncnn.. but in mac os :( . caffe is about 30-FPS and ncnn around 7-FPS with the same configurations on CPU.. i can post the first two stages of my code with opencv::dnn here if that is of some help?

aguila gravatar imageaguila ( 2018-11-03 08:10:09 -0500 )edit

@aguila, -- yes, please, let's see the code ! (why not put it on github, even ;) ?)

and, btw, which layers do Scores Data , etc refer to ?

made some program recently, that prints out the opencv dnn layers, and got this

(the network layer names are not exactly the same, so this shouldn't be a problem, imho)

berak gravatar imageberak ( 2018-11-03 08:27:08 -0500 )edit

okay! i will just get some sushi and then create a github repo.. the names i defined as:

ScoresData is the "cls_prob" layer

RegressionData the "bbox_reg_1" layer

RotateData the "rotate_cls_prob" layer

layer name "cls_prob" is in the three networks present no? and "rotate_cls_prob" is in the first two networks

aguila gravatar imageaguila ( 2018-11-03 08:32:03 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2018-11-05 13:54:09 -0500

aguila gravatar image

updated 2018-11-05 15:52:25 -0500

solved... the error was accessing bad dimensions of blob

edit flag offensive delete link more

Question Tools



Asked: 2018-11-03 05:48:38 -0500

Seen: 265 times

Last updated: Nov 05 '18