A question about TensorRT3.0 the createSSDDetectionOutputPlugin plugin

I want to use tensorrt3.0 to improve the time performance of SSD on jetson tx2.When I use the createSSDDetectionOutputPlugin plugin, I have the same problem about “Plugin layer output count is not equal to caffe output count”.However, when I remove the detectout layer from prototxt file and I did not use the the createSSDDetectionOutputPlugin plugin, it can run well and I can get output of the mbox_loc and mbox_conf layer.
Please help me,thank you! @AastaLLL


Our users have met this issue before.
Please check following topic for more information:


Thank you for your reply. I’ve already seen it , but I still can’t solve this error. Whether the createSSDDetectionOutputPlugin plugin has a special use method and it is not specified in the NVinferplugin.h


Could you share more information about createSSDDetectionOutputPlugin?

Thank you for your reply.
I got the dims(CHW) of mBox_loc, mBox_prior and mBox_conf_flatten layer by using engine.getBindingDimensions().
mBox_loc: dims = 34928, 1, 1 (CHW)
mBox_prior: dims = 2, 34928, 1 (CHW)
mBox_conf_flatten: dims = 183372, 1, 1 (CHW)

I add createSSDDetectionOutputPlugin in my coda as below:

if (!strcmp(layerName, “detection_out”))
assert(mPluginDetectionOut == nullptr);

mPluginDetectionOut = std::unique_ptr<INvPlugin, decltype(nvPluginDeleter)>(createSSDDetectionOutputPlugin({true, false, 0, 21, 400, 200, 0.01, 0.45, CodeType_t::CENTER_SIZE}), nvPluginDeleter);
return mPluginDetectionOut.get();


I add SSDDetectionOutputPlugin in my prototxt file as below:
layer {
name: “detection_out”
type: “IPlugin”
bottom: “mbox_loc”
bottom: “mbox_conf_flatten”
bottom: “mbox_priorbox”
top: “detection_out”

@AastaLLL, did you find my mistake? I can send you my code via private message if necessary .
Thank you very much!


createSSDDetectionOutputPlugin doesn’t in our TensorRT document and also not in our support scope.
It may still under developing, and we don’t have information can share with you.

Sorry for the inconvenience.

Thank you for your reply.
Looking forward to your new TensorRT3.0.

Hi,@chenzhi745320,I have the same error “Plugin layer output count is not equal to caffe output count”, and have you solved it, thank you.


Some user has met this issue before.
Please check this topic for information:


Hi, @AastaLLL
I’ve seen that issue, but still do not solve the problem. I rewrite the Flatten layer in the ssd network like the format of the Reshape layer ,and the function getNbOutputs() reutrns 1. Is there anything wrong ? And can you show more details about the error “Plugin layer output count is not equal to caffe output count”.
Thank you.


Usually, the Plugin layer output count is not equal to Caffe output count error comes from incorrect layer definition or implementation.

Are you running TensorRT with a custom implementation?
If yes, please recheck the dimension definition in your plugin layer.



please see this thread for the fix of error ‘Plugin layer output count is not equal to caffe output count’


Thanks for sharing the information.