title: Input shape for Keras conv1D with sequential data
body: <p>I want to use Conv1D for making dilated convolution network to a sequential dataset.<br>
  So I tried Conv1D with Boston dataset.</p>
  
  <pre><code>from tensorflow.python.keras.layers import Conv1D, MaxPooling2D
  from tensorflow.python.keras.layers import Activation, Dropout, Flatten, Input, Dense
  from tensorflow.python.keras.models import Model
  from sklearn.datasets import load_boston
  from sklearn.model_selection import train_test_split
  
  boston = load_boston()
  df = pd.DataFrame(boston.data,columns=boston.feature_names)
  df['target']= boston.target
  y = df['target']
  X = df.drop(columns=['target'])
  X_train, X_test, y_train, y_test = train_test_split( X, y, test_size=0.2, random_state=2)
  
  def NN_model(data= X_train):
    #data = np.expand_dims(data, axis=2)
    inputs = Input(((data.shape)))
    x = Conv1D(2,2,dilation_rate=2,padding="same", activation="relu")(inputs)
    x = Flatten()(x)
    x = Dense(2048, activation="relu")(x)
    predictions = Dense(1)(x)
    model = Model(inputs=inputs, outputs=predictions)
    model.compile(optimizer="adam",loss='mean_squared_error')
    model.summary()
    return model
  nn_model = NN_model(X_train)
  </code></pre>
  
  <p>The model had no errors, but when I tried </p>
  
  <pre><code>nn_model.fit(X_train,y_train)
  </code></pre>
  
  <p>and it rised an error as</p>
  
  <pre><code>ValueError: Error when checking input: expected input_1 to have 3 dimensions, but got array with shape (404, 13)
  </code></pre>
  
  <p>And I added this new line in function NN_model as </p>
  
  <pre><code>def NN_model(data= X_train):
    data = np.expand_dims(data, axis=2)
  </code></pre>
  
  <p>or</p>
  
  <pre><code>def NN_model(data= X_train):
    data = np.reshape(X_train.values, (-1, data[1], 1))
  
  </code></pre>
  
  <p>but it raised an error in the model as </p>
  
  <pre><code>ValueError: Input 0 of layer conv1d_1 is incompatible with the layer: expected ndim=3, found ndim=4. Full shape received: [None, 404, 13, 1]
  </code></pre>
  
  <p>What should I do?</p>