IndexError: Target 2 is out of bounds

This should work:

tensor_train_y = tensor_train_y - 1
tensor_test_y = tensor_test_y - 1
1 Like