title: TypeError: Error converting shape to a TensorShape: Only size 1 arrays are accepted
body: <p>I'm currently stuck on an error regarding my neural network. The dataset consists of a 2418 arrays with each containing 400 numbers. The shape is (2418,400). After trial and error I reshaped this to (2418,400,1) because I thought that would be better for the model. The error I receive when running is:</p>
  
  <pre><code>Traceback (most recent call last):
  
    File "&lt;ipython-input-15-370efbb6619c&gt;", line 9, in &lt;module&gt;
      model.add(LSTM(128, input_shape=(Xreshaped), activation='relu', return_sequences=True))
  
    File "C:\Users\Tijev\Anaconda3\envs\tfp3.6\lib\site-packages\tensorflow\python\training\checkpointable\base.py", line 442, in _method_wrapper
      method(self, *args, **kwargs)
  
    File "C:\Users\Tijev\Anaconda3\envs\tfp3.6\lib\site-packages\tensorflow\python\keras\engine\sequential.py", line 160, in add
      name=layer.name + '_input')
  
    File "C:\Users\Tijev\Anaconda3\envs\tfp3.6\lib\site-packages\tensorflow\python\keras\engine\input_layer.py", line 231, in Input
      input_tensor=tensor)
  
    File "C:\Users\Tijev\Anaconda3\envs\tfp3.6\lib\site-packages\tensorflow\python\keras\engine\input_layer.py", line 107, in __init__
      name=self.name)
  
    File "C:\Users\Tijev\Anaconda3\envs\tfp3.6\lib\site-packages\tensorflow\python\keras\backend.py", line 876, in placeholder
      x = array_ops.placeholder(dtype, shape=shape, name=name)
  
    File "C:\Users\Tijev\Anaconda3\envs\tfp3.6\lib\site-packages\tensorflow\python\ops\array_ops.py", line 2077, in placeholder
      return gen_array_ops.placeholder(dtype=dtype, shape=shape, name=name)
  
    File "C:\Users\Tijev\Anaconda3\envs\tfp3.6\lib\site-packages\tensorflow\python\ops\gen_array_ops.py", line 5788, in placeholder
      shape = _execute.make_shape(shape, "shape")
  
    File "C:\Users\Tijev\Anaconda3\envs\tfp3.6\lib\site-packages\tensorflow\python\eager\execute.py", line 147, in make_shape
      raise TypeError("Error converting %s to a TensorShape: %s." % (arg_name, e))
  
  TypeError: Error converting shape to a TensorShape: only size-1 arrays can be converted to Python scalars.
  </code></pre>
  
  <p>I've looked at a similar post on Stackoverflow but the answer didn't work out for this case. My code looks like this:</p>
  
  <pre><code>model = Sequential()
  model.add(LSTM(128, input_shape=(Xreshaped), activation='relu', return_sequences=True))
  model.add(Dropout(0,2))
  model.add(LSTM(128, activation='relu'))
  model.add(Dropout(0,2))
  model.add(Dense(32, activation='relu'))
  model.add(Dropout(0,2))
  model.add(Dense(2, activation='sigmoid'))
  
  opt = tf.keras.optimizers.Adam(lr=1e-3, decay=1e-5)
  
  # mean_squared_error = mse
  model.compile(loss='sparse_categorical_crossentropy',
                optimizer=opt,
                metrics=['accuracy'])
  
  model.fit(X, Y, epochs=3, validation_data=(X, Y))
  </code></pre>