BEVFormer_tensorrt icon indicating copy to clipboard operation
BEVFormer_tensorrt copied to clipboard

When doing yolox/trt_evaluate.sh for fp32 tensorrt model, what's the reason this error occurred? how can i fix it?

Open NutshellLee opened this issue 2 years ago • 2 comments

trt_model checkpoints/tensorrt/yolox_x_8x8_300e_coco_20211126_140254-1ef88d67.trt loading annotations into memory... Done (t=0.55s) creating index... index created! [ ] 0/4952, elapsed: 0s, ETA:Traceback (most recent call last): File "tools/2d/evaluate_trt.py", line 142, in main() File "tools/2d/evaluate_trt.py", line 103, in main engine, context, input_shapes=input_shapes_, output_shapes=output_shapes_ File "./det2trt/utils/tensorrt.py", line 49, in allocate_buffers context.set_binding_shape(binding_id, dims) AttributeError: 'NoneType' object has no attribute 'set_binding_shape'

NutshellLee avatar Jul 20 '23 03:07 NutshellLee

You can set https://github.com/DerryHub/BEVFormer_tensorrt/blob/1b39aac2fc260b65347a9479bb4e85905c37dff2/tools/2d/evaluate_trt.py#L40 to trt.Logger.VERBOSE to see how the error happened.

DerryHub avatar Jul 20 '23 03:07 DerryHub

Hi, I believe it's a bug. When evaluating fp32 trt yolox-x model, I found that the context is none, which means engine.create_execution_context() returns none. But the engine is not none. It doesn't happen in other precision types of trt, only in fp32 trt. fp32 pth model works fine too.

NutshellLee avatar Jul 20 '23 06:07 NutshellLee