title: I can not convert my lists to tensors for fit in keras model
body: <p>i defined a deep model like below:</p>
  <pre><code>    model = Sequential()
      inputs = keras.Input(shape=(19,))
      layer1 = Dense(38, activation='relu')(inputs)
      layer2 = Dense(19, activation='relu')(layer1)
      layer3 = Dense(38, activation='relu')(layer2)
  
      outputs1 = keras.layers.Dense(19, activation='softmax', name='loss1')(layer3)
      outputs2 = keras.layers.Dense(19, activation='softmax', name='loss2')(layer3)
  
      model = keras.Model(inputs=[inputs], outputs=[outputs1,outputs2])
  
     model.compile(loss=['kullback_leibler_divergence', 'kullback_leibler_divergence'], 
     metrics=['accuracy'], optimizer='adam', loss_weights=[1.0, 1.0])
  
     model.fit(X_train,[y1_target,y2_target],epochs=10,batch_size=64)
  </code></pre>
  <p>but I get this error:</p>
  <p>Failed to convert a NumPy array to a Tensor (Unsupported object type list).</p>
  <p>so i've tried to convert list to tensor by:</p>
  <pre><code>    tf.convert_to_tensor(X_train, dtype=tf.float32)
  </code></pre>
  <p>i've got this error: setting an array element with a sequence.</p>
  <p>so I tried to use the below code:</p>
  <pre><code>    def vector_seq(sequences, dimension =19):
        print(type(sequences))
        results = np.zeros((len(sequences), dimension))
        for i, sequence in enumerate(sequences):
           results[i, sequence] = 1.
      return results
  
      X_train = vector_seq(X_train)
     y1_target = asarray(y1_target)
     y2_target = asarray(y2_target)
  </code></pre>
  <p>but again for the above code I've got this error:
  only integers, slices (<code>:</code>), ellipsis (<code>...</code>), numpy.newaxis (<code>None</code>) and integer or boolean arrays are valid indices</p>
  <p>X_train is like this image: <a href="https://i.stack.imgur.com/Zc9ra.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Zc9ra.png" alt="enter image description here" /></a>
  and y1_target and y2_target are similar to X_train.</p>
  <p>How can I solve these errors?</p>