history = model.fit(X, y, batch_size=32, epochs=40, validation_split=0.1)
the line problem was this
Showing error:
ValueError: Failed to find data adapter that can handle input: <class 'numpy.ndarray'>, (<class 'list'> containing values of types {"<class 'int'>"})
I was facing the same issue. Turns out it was a in the form of a list. I had to convert the fields into a numpy array like:
training_padded = np.array(training_padded)
training_labels = np.array(training_labels)
testing_padded = np.array(testing_padded)
testing_labels = np.array(testing_labels)
thats it!
ValueError in TensorFlow
https://pythonprogramming.net/convolutional-neural-network-deep-learning-python-tensorflow-keras/
I tried following code and worked for me:
IMG_SIZE = 50
X = np.array(X).reshape(-1, IMG_SIZE, IMG_SIZE, 1)
y = np.array(y)
history = model.fit(X, y, batch_size=32, epochs=40, validation_split=0.1)
So this is happening the the newer version of tensorflow I'm not sure from where but I was on version 2.0.0 and this same thing happened
I'm assuming that you are only converting the X array into a numpy array But rather try converting 'X' as well as 'y' to numpy array using the dtype as np.uint8
That should resolve the problem
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With