'can't convert np.ndarray of type numpy.object_. The only supported types are: float64, float32

train_labels = torch.tensor(train_labels)

I tried to to torch tenser a train_labels but it give me the same warning

and the président code works fine and give good results but I need to understand this warning :

TypeError: can't convert np.ndarray of type numpy.object_. The only supported types are: float64, float32, float16, complex64, complex128, int64, int32, int16, int8, uint8, and bool.

thanks for help



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source