cathy-kim / Pelee-TensorRT

Pelee(NeurIPS'18)-TensorRT Implementation (Caffe Parser)
86 stars 29 forks source link

Assertion `C2 == inputDims[param.inputOrder[1]].d[0]' failed. #13

Closed newforrestgump001 closed 9 months ago

newforrestgump001 commented 5 years ago

since my tensorrt is 6.0,so I removed pelee_merged.caffemodel.cache and run ./build/bin/pelee But it did not succeed. The log shows: pelee: nvPluginsLegacy.cpp:1026: virtual void nvinfer1::plugin::DetectionOutputLegacy::configure(const nvinfer1::Dims, int, const nvinfer1::Dims, int, int): Assertion `C2 == inputDims[param.inputOrder[1]].d[0]' failed. Aborted (core dumped)

Please give my some hints for modification, Sincere thanks for you!

cathy-kim commented 4 years ago

Hi. @newforrestgump001
This is based on TensorRT version 4.x. Maybe I will release this code based on TensorRT ver 6.

Thank you.

newforrestgump001 commented 4 years ago

@ginn24 Thank you a lot for your information!

sudo-wang commented 4 years ago

@cathy-kim Hi, Thanks to your work. Since my tensorRT is 6.0, so I met the same problem. The log shows: pelee: nvPluginsLegacy.cpp:1026: virtual void nvinfer1::plugin::DetectionOutputLegacy::configure(const nvinfer1::Dims, int, const nvinfer1::Dims, int, int): Assertion `C2 == inputDims[param.inputOrder[1]].d[0]' failed. Aborted (core dumped) I am in trouble, could you please give me some Suggestions for modification. Thanks a lot!!

rmccorm4 commented 4 years ago

I found a couple repos with a similar original pelee caffemodel without the TensorRT plugins integrated that this might be based on: https://github.com/Robert-JunWang/Pelee and https://github.com/eric612/MobileNet-YOLO/tree/master/models/pelee

Based on this issue (https://github.com/sfzhang15/FaceBoxes/issues/30#issuecomment-470769992) - The pelee model seems to depend on a fork of caffe, called caffe-ssd: https://github.com/weiliu89/caffe/tree/ssd .

There's a docker image here that might save some time (https://hub.docker.com/r/pkdogcom/caffe-ssd/), but I don't know if it comes with everything you'll need or not.

I would suggest trying to convert that Caffemodel to ONNX, and use TensorRT's ONNX parser on that resulting ONNX Model. I think most of the plugin layers in this repo (Reshape, Softmax, Flatten) might now be supported natively by TensorRT, and will probably be more performant than plugins.

Once you've figured out how to build the Caffe fork that supports the Pelee models layers, you might be able to use a tool like this one or similar to convert the caffemodel to ONNX: https://github.com/htshinichi/caffe-onnx. You might need to look into other tools.

I don't know the best way to do this, but I think it's worth looking into getting an ONNX version of this model if you're interested in using it with TensorRT.

sudo-wang commented 4 years ago

@rmccorm4 Hi, Many thanks for your help! I will try it.

sudo-wang commented 4 years ago

@daodao316 Not yet I'm busy with other things recently, I will try it later

daodao316 commented 4 years ago

@rmccorm4 ,I met the same problem in tensorrt6. Everything is right when I use tensorrt5. I find when the layer has multi input, eg. createConcatPlugin and createSSDDetectionOutputPlugin, the parm inputDims in configure(const Dims inputDims, int nbInputs, const Dims outputDims, int nbOutputs, int maxBatchSize) are all same as the first input dim. I print the value of inputDims in this function in tensorrt6 eg: Concat configure------------------------------------------------ inputDims 0: 264 11 20 inputDims 1: 264 11 20 inputDims 2: 264 11 20 outputDims 0: 288 11 20 DetectionOutput configure------------------------------------------------ inputDims 0: 76528 1 1 inputDims 1: 76528 1 1 inputDims 2: 76528 1 1 outputDims 0 : 1 100 7 outputDims 1: 1 100 7 when I skip the configure in DetectionOutput where the error occurs, and set successStatus to True.I can generate the model successful, but the out boxes are wrong. I use Pluginv1 and tensorrt6.

Compare with tensorrt5(Everything Right): Concat configure------------------------------------------------ input 0: 264 11 20 input 1: 12 11 20 input 2: 12 11 20 outputDims 0: 288 11 20 DetectionOutput configure------------------------------------------------ input 0: 76528 1 1 input 1: 57396 1 1 input 2: 2 76528 1 outputDims 0: 1 100 7 outputDims 1: 1 1 1