• Hardware Platform : GPU
• DeepStream 5.0
• TensorRT 7
• NVIDIA GPU Driver Version :440.59
So I’m migrating my tensorrt based custom model to PyDS, and I need to post-process on the whole output tensor, which is big so get_detections(layer.buffer, index) wont be efficient (Also couldn’t find get_detections() in the documentation)
I got my tensor output using
layer = pyds.get_nvds_LayerInfo(*params)
then inspecting layer.buffer, it was a pycapsule object
so I decoded it to byte-buffer using
byte_buffer = ctypes.pythonapi.PyCapsule_GetPointer(layer.buffer, None)
Now when I use
nd_arr = np.frombuffer(byte_buffer)
numpy throws the following error
ValueError: buffer size must be a multiple of element size
I’m suspecting either of these :
- It needs to be transferred to host memory first?
- Wrong datatype when converting buffer to numpy
- Don’t remember the third
Then there’s a binding of CudaToNumpy in jetson-utils that I can try to port but It’s kinda urgent.
Is this right approach? Please guide how to take this forward.