Context->destory() error

Description

when I run context->destory(), I meet an error, [engine.cpp::nvinfer1::rt::Engine::getProfileBeginEnd::863] Error Code 2: Internal Error (Assertion profileIndex + 1 < static_cast<int32_t>(mProfileStartIndices.size()) failed. ), it’s why and how to solve it ?

Environment

TensorRT Version: 8.2.1.14
GPU Type: gtx1660
Nvidia Driver Version: 511.23
CUDA Version: 11.6
CUDNN Version: 8
Operating System + Version: windows 10, visual studio2019
Python Version (if applicable):
TensorFlow Version (if applicable):
PyTorch Version (if applicable):
Baremetal or Container (if container which image + tag):

Hi,
Please refer to below links related custom plugin implementation and sample:

While IPluginV2 and IPluginV2Ext interfaces are still supported for backward compatibility with TensorRT 5.1 and 6.0.x respectively, however, we recommend that you write new plugins or refactor existing ones to target the IPluginV2DynamicExt or IPluginV2IOExt interfaces instead.

Thanks!

there are no custom plugin in my tensorrt project ,but still existing such problom

Hi,

Looks like context->destroy() is deprecated.
https://docs.nvidia.com/deeplearning/tensorrt/api/c_api/classnvinfer1_1_1_i_execution_context.html#ab3ace89a0eb08cd7e4b4cba7bedac5a2

Could you please try delete instead of destroy().

If you still face this issue, please share with us a minimal issue repro ONNX model and script for better debugging?

Thank you.