title: (Keras) ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type float)
body: <p>I know this problem has been answered previously in the link below,but it does not apply to my situation.(<a href="https://stackoverflow.com/questions/58636087/tensorflow-valueerror-failed-to-convert-a-numpy-array-to-a-tensor-unsupporte">Tensorflow - ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type float)</a>)</p>
  
  <p>Both my predictor (X) and target variables (y) are <code>&lt;class 'numpy.ndarray'&gt;</code> and their shapes are 
  X: (8981, 25)
  y: (8981, 1)</p>
  
  <p>Yet, I am still getting the error message. 
  ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type float).</p>
  
  <p>Please refer to the following code:</p>
  
  <pre><code>import tensorflow as tf
  ndim = X.shape[1]
  model = tf.keras.models.Sequential()
  # model.add(tf.keras.layers.Flatten())
  model.add(tf.keras.layers.Dense(36, activation = tf.nn.relu, input_dim=ndim))
  model.add(tf.keras.layers.Dense(36, activation = tf.nn.relu))
  model.add(tf.keras.layers.Dense(2, activation = tf.nn.softmax))
  model.compile(optimizer = 'adam',
                loss = 'sparse_categorical_crossentropy',
                metrics = ['accuracy'])
  model.fit(X.values, y, epochs = 5)
  y_pred = model.predict([X_2019])
  </code></pre>
  
  <p>Any help will be really appreciated! Thanks!!!</p>