grimoire / mmdetection-to-tensorrt

convert mmdetection model to tensorrt, support fp16, int8, batch input, dynamic shape etc.
Apache License 2.0
590 stars 85 forks source link

FCOS head Bug:x1 y1 will be overstep the boundary and are set to 0。 #88

Open Xingxu1996 opened 3 years ago

Xingxu1996 commented 3 years ago

Describe the bug Before batched_distance2bbox function, all the inputs value are same between original model and trt model. But the outputs of the function are different, there are lots of x1, y1 are set to 0 in trt model, while the values of x1, y1 in original model are correct.

After I change batched_distance2bbox(points, bbox_pred, x.shape[2:]) to batched_distance2bbox(points, bbox_pred,(800, 1333)), the results turn to right, and the results is same to the original model。 But I don‘t know why?

In batched_distance2bbox(points, bbox_pred, x.shape[2:]) function, I print(max_shape), and it's actually toch.Size([800, 1333])。Why x1, y1 are set to 0 ?

grimoire commented 3 years ago

Hi Are you using the latest code? Please update amirstan_plugin, torch2trt_dynamic and mmdetection-to-tensorrt and try again. Also, note that the current master requires mmdet>=2.18 which is slightly different from the previous version. If you still have the same problem, please provide your environment and script to reproduce the error.