tensorrt-ssd-easy icon indicating copy to clipboard operation
tensorrt-ssd-easy copied to clipboard

Do I need to implement softmax layer myself or I can run this code directly?

Open zbw4034 opened this issue 6 years ago • 4 comments

In Chen1992's code,I need to implement softmax myself and in this code do I need to do so as well or I can run it directly? Any replies are apprciated,thx!!!

zbw4034 avatar Aug 02 '18 01:08 zbw4034

For ssd, you don't need to and just run it directly.

JingliangGao avatar Aug 02 '18 10:08 JingliangGao

@JingliangGao Thank you very much! I have found that pluginInplement.h includes softmax plugin. But when I run the code, my output results are not correct llike this:

Bindings after deserializing: Binding 0 (data): Input. Binding 1 (detection_out): Output. INPUT Tensor Shape is: C: 3 H: 300 W: 300 mbox_conf_softmax Tensor Shape is: C: 0 H: 0 W: 0 mbox_loc Tensor Shape is: C: 0 H: 0 W: 0 mbox_priorbox Tensor Shape is: C: 0 H: 0 W: 0 OUTPUT Tensor Shape is: C: 1 H: 200 W: 7 Allocate memory: input blob Allocate memory: output blob Enter image path:cccp [cuda] cudaAllocMapped 1080000 bytes, CPU 0x101650000 GPU 0x101650000 Came into the image inference method here. flatten enqueue:1;23104 flatten enqueue:1;121296 flatten enqueue:1;8664 flatten enqueue:1;45486 flatten enqueue:1;2400 flatten enqueue:1;12600 flatten enqueue:1;600 flatten enqueue:1;3150 flatten enqueue:1;144 flatten enqueue:1;756 flatten enqueue:1;16 flatten enqueue:1;84 flatten enqueue:1;733488 flatten enqueue:1;183372 Time: 119.558 ms 0 -1 0 0 0 0 0 0 -1 0 0 0 0 0 0 -1 0 0 0 0 0 0 -1 0 0 0 0 0 0 -1 0 0 0 0 0 0 -1 0 0 0 0 0 0 -1 0 0 0 0 0 0 -1 0 0 0 0 0 0 -1 0 0 0 0 0 0 -1 0 0 0 0 0

The model I use is official caffemodel VGG_VOC0712_SSD_300x300_iter_120000.caffemodel,and deploy file is the one provided in this project.It seems that there is something wrong with softmax,right?And the model is for 21 calsses,so maybe it's weird to find the output tensor is 200*7. Could you give me some suggestions?

Thank you again and wish you happyness!!!

zbw4034 avatar Aug 03 '18 02:08 zbw4034

Well. The reason why you met this problem is that the prototxt in this project is not right. Softmax iplugin is correct in this project . 200 is the top-k number and you can set it in your own project .7 maybe the number of inference value I guess. For you, 0 -1 0 0 0 0 0,the number of them is 7.

JingliangGao avatar Aug 03 '18 03:08 JingliangGao

@JingliangGao Thanks for your reply! I found that all my tensor shape is 0,which is like this:

INPUT Tensor Shape is: C: 3 H: 300 W: 300 mbox_conf_softmax Tensor Shape is: C: 0 H: 0 W: 0 mbox_loc Tensor Shape is: C: 0 H: 0 W: 0 mbox_priorbox Tensor Shape is: C: 0 H: 0 W: 0 OUTPUT Tensor Shape is: C: 1 H: 200 W: 7

does this mean anything wrong? by the way,could you share your prototxt with me? my email is [email protected]

thank you very much because you are the only one replying me~

zbw4034 avatar Aug 07 '18 07:08 zbw4034