Error "Tensor image cannot be both input and output"

We have a custom model that gives output confidence and paf while takes image as input. We are getting this error:

nvinfer gstnvinfer.cpp:511:gst_nvinfer_logger:<primary_gie_classifier> NvDsInferContext[UID 1]:log(): Tensor image cannot be both input and output


This error indicates that the same layer used as input and output.
It’s recommended to check the output layer name which is used for converting the TensorRT model first.