nv-morpheus / Morpheus

Morpheus SDK
Apache License 2.0
333 stars 124 forks source link

[BUG]: TensoryMemory does not work with uint arrays #1619

Closed edknv closed 4 months ago

edknv commented 4 months ago

Version

24.03

Which installation method(s) does this occur on?

branch-24.03

Describe the bug.

TensoryMemory does not seem to work with certain data types, e.g. uint8.

Minimum reproducible example

>>> import cupy as cp
>>> import numpy as np
>>> from morpheus._lib.messages import TensorMemory as CppTensorMemory
>>> array = np.array([[1, 2], [3, 4]], dtype=np.uint8)
>>> array = cp.asarray(array)
>>> CppTensorMemory(count=array.shape[0], tensors={"array": array})
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: stoi

The same code does work if dtype is switched to int16.

>>> array = np.array([[1, 2], [3, 4]], dtype=np.int16)                                    
>>> array = cp.asarray(array)
>>> CppTensorMemory(count=array.shape[0], tensors={"array": array})
<morpheus._lib.messages.TensorMemory object at 0x7c309476aaf0>

Relevant log output

Click here to see error details

 [Paste the error here, it will be hidden by default]

Full env printout

Click here to see environment details

 [Paste the results of print_env.sh here, it will be hidden by default]

Other/Misc.

No response

Code of Conduct