The error occurs asy_train
contains non-numeric data, which is not compatible with torch.tensor
.
Check the contents of y_train
and ensure that the is only numeric values so you can safely convert to a tensor.
Also, based on the error it seems the incorrect type in y_train
is a numpy object.