I just got the error that Inputs to a layer should be tensors
for Keras
.
However, in the tidymodels
documentation, I was unable to find a step_*
function that transforms the data into tensors.
Is there such a function, or do I have to develop my own recipe function? tidymodels - Create your own recipe step function
So what I tried was
df |>
mutate(across(-yy, as_tensor))
But gives error
Error in `vec_size()`:
! `x` must be a vector, not a <tensorflow.tensor/tensorflow.python.framework.ops.EagerTensor/tensorflow.python.framework.ops._EagerTensorBase/tensorflow.python.framework.ops.Tensor/tensorflow.python.client._pywrap_tf_session.PyTensor/tensorflow.python.types.internal.NativeObject/tensorflow.python.types.core.Symbol/tensorflow.python.types.core.Value/tensorflow.python.types.core.Tensor/python.builtin.object> object.