Example of how to fix ValueError: Failed to convert a NumPy array to a Tensor:
While trying to fit a model (see Model training APIs):
model.fit(train_x, train_y, epochs=600, batch_size=400, verbose=0, callbacks=[tfdocs.modeling.EpochDots()])
if you get the error message:
ValueError: Failed to convert a NumPy array to a Tensor
train_x = np.asarray(train_x).astype(np.float32)
train_y = np.asarray(train_y).astype(np.float32)
It is the most common errors.
Hi, I am Ben.
I have developed this web site from scratch with Django to share with everyone my notes. If you have any ideas or suggestions to improve the site, let me know ! (you can contact me using the form in the welcome page). Thanks!