"ValueError: Unsupported dtype <U1" when change <class numpy.ndarray> to <class cupy.array>

Viewed 18

I change some codes using numpy to cupy because of speed.

when usingdata_class = data_A[B]["class"], It works, data type is <class 'numpy.ndarray'>, and Data is ['N' 'N' 'N' ... 'N' 'N' 'N']

But, When I change to cupy.array to using GPU, It occur ValueError: Unsupported dtype <U1

I changed like this... data_class = cp.array(data_A[B]["class"]) or data_class = cp.array(data_A[B]["class"],dtype='unicode') but it also have ValueError.

How can I change <class 'numpy.ndarray'> to <class 'cupy.array'>?

Thank you.

0 Answers
Related