Skip to content
Advertisement

ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type numpy.ndarray). in trying to predict tesla stock

In the end you can see that i have tried converting this into a numpy array but I don’t understand why tensorflow dosen’t support it? I have looked at the other related pages but none seemed to help. Is there some other format i have to do to the data in order to properly fit in model?

this is what keras says: x
Vector, matrix, or array of training data (or list if the model has multiple inputs). If all inputs in the model are named, you can also pass a list mapping input names to data. x can be NULL (default) if feeding from framework-native tensors (e.g. TensorFlow data tensors).

y
Vector, matrix, or array of target (label) data (or list if the model has multiple outputs). If all outputs in the model are named, you can also pass a list mapping output names to data. y can be NULL (default) if feeding from framework-native tensors (e.g. TensorFlow data tensors).

JavaScript

Advertisement

Answer

this worked tf.convert_to_tensor(y)

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement