title: ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type numpy.ndarray) in Tensorflow
body: <p>I am creating a new Pandas Dataframe column using 4 other columns applying custom defined function row wise.</p>
  <p>Below is the structure of the columns,  the function is applying on.</p>
  <p><a href="https://i.stack.imgur.com/FSnIP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FSnIP.png" alt="enter image description here" /></a></p>
  <p>The new column created looks like this.</p>
  <p><a href="https://i.stack.imgur.com/4AKoS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4AKoS.png" alt="enter image description here" /></a></p>
  <p>The function I wrote is as follows:</p>
  <pre><code>def convert_credit_rows(row):
    return np.asarray([row['A'], row['B'], row['C'], row['D']], dtype=np.float32)
  
  X_train['credit_balance'] = X_train.apply(convert_credit_rows, axis=1)
  X_test['credit_balance'] = X_test.apply(convert_credit_rows, axis=1)
  </code></pre>
  <p>I am providing this dataset to a simple neural network as follows:</p>
  <pre><code>def CreditBalanceDetector():
  
    X_train_credit_balance = X_train['credit_balance']
    X_test_credit_balance = X_test['credit_balance']
  
    model = Sequential()
    model.add(Dense(20, activation='relu'))
    model.add(Dense(10, activation='relu'))
    model.add(Dense(6, activation='softmax'))
  
    model.compile(loss='categorical_crossentropy', optimizer=Adam(learning_rate=0.0005), 
    metrics=['accuracy'])
    early_stop = EarlyStopping(monitor='val_loss',patience=3)
    model.fit(X_train_credit_balance, y_train, epochs=50, validation_data=
    (X_test_credit_balance, y_test), callbacks=[early_stop])
  </code></pre>
  <p>But when trying to train the model I am getting the following error.</p>
  <p><a href="https://i.stack.imgur.com/z0f9s.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/z0f9s.png" alt="enter image description here" /></a></p>
  <p>Though there are couple of similar questions in StackOverflow the solutions suggested there didn't work for me.</p>
  <p>If someone could figure out where I'm going wrong that would be much appreciated. Thank you.</p>