zhouyuchong / face-recognition-deepstream

Deepstream app use retinaface and arcface for face recognition.
MIT License
60 stars 13 forks source link

convert_batch_and_push_to_input_thread:<sgie> error: NvBufSurfTransform failed with error -3 while converting buffer #24

Closed Song-Gy closed 1 year ago

Song-Gy commented 1 year ago

image When sgie is connected, the pipeline starts to have the following error at the end of the video. I checked the source code of nvinfer.cpp and found that this is caused by the type mismatch when the sgie node is zoomed and changed. Have you ever encountered this problem? How to solve it?

Song-Gy commented 1 year ago

In this pipeline, I did not use tracker behind pgie, but put sgie directly behind pgie, and added a queue in the middle. I just tried to add the tracker between pgie and sgie, and the above problem did not appear. What is the problem? If I don't want to use tracker to avoid this problem, is there any other solution?

zhouyuchong commented 1 year ago

@Song-Gy Which gst-nvinfer are you using? I don't think this problem is associated with nvtracker. As logs mentioned above, can you add some outputs for checking in source codes of gst-nvinfer?

  if (batch->frames.size() > 0) {
    /* Batched tranformation. */
    err = NvBufSurfTransformAsync (&nvinfer->tmp_surf, mem->surf,
              &nvinfer->transform_params, &batch->sync_obj);
  }

  nvtxDomainRangePop (nvinfer->nvtx_domain);

  if (err != NvBufSurfTransformError_Success) {
    GST_ELEMENT_ERROR (nvinfer, STREAM, FAILED,
        ("NvBufSurfTransform failed with error %d while converting buffer", err),
        (NULL));
    return FALSE;
  }

Also, you can check the params and error types from here. Yours seems like

NvBufSurfTransformError_Invalid_Params= -3

check these transformer params.

Song-Gy commented 1 year ago

Thank you for your hint. After adding the test, I found that the left parameter of src_rect in the incoming transform_params is max_unsigned_int = 4294967288. This is because the left in the incoming object_meta.rect_params is less than zero and converted to unsigne int. In the post-processing, CLIP has been used to limit the left to the range of [0, network_info->width-1]. After investigation, I found that I set symmetric-padding=1 in the config of pgie, which resulted in the result of subtracting offset_left from the left coordinates in the subsequent processing of attach_metadata_detector to be less than zero, which caused the initial pipeline crash. . image