title: How to reshape my data for the convolution neural network model?
body: <p>I need to let input in my convolution neural network model a reshaping data, 
  But  my problem is with line of code: </p>
  
  <pre><code>model = Sequential()
  input_traces = Input(shape=(3253,))
  model.add(Convolution1D(nb_filter=32, filter_length=3, 
  activation='relu',input_shape = input_traces))      
  </code></pre>
  
  <p>This line gives me this error: </p>
  
  <pre><code>   CNN_Based_Attack.py:139: UserWarning: Update your `Conv1D` call to the Keras 2 API: `Conv1D(activation="relu", input_shape=(None, /in..., padding="same", filters=32, kernel_size=3)`
    model.add(Convolution1D(nb_filter=32, filter_length=3, border_mode='same', activation='relu',input_dim=input_traces))
  Traceback (most recent call last):
    File "CNN_Based_Attack.py", line 139, in &lt;module&gt;
      model.add(Convolution1D(nb_filter=32, filter_length=3, border_mode='same', activation='relu',input_dim=input_traces))
    File "/home/.local/lib/python2.7/site-packages/keras/models.py", line 430, in add layer(x)
    File "/home/.local/lib/python2.7/site-packages/keras/engine/topology.py", line 557, in __call_self.build(input_shapes[0])
    File "/home/.local/lib/python2.7/site-packages/keras/layers/convolutional.py", line 134, in build
      constraint=self.kernel_constraint)
    File "/home/.local/lib/python2.7/site-packages/keras/legacy/interfaces.py", line 88, in wrapper return func(*args, **kwargs)
    File "/home/.local/lib/python2.7/site-packages/keras/engine/topology.py", line 390, in add_weight
      weight = K.variable(initializer(shape), dtype=dtype, name=name)
    File "/home/.local/lib/python2.7/site-packages/keras/initializers.py", line 200, in __call__
      scale /= max(1., float(fan_in + fan_out) / 2)
  TypeError: float() argument must be a string or a number
  </code></pre>
  
  <p>When I try to mdify it:</p>
  
  <pre><code>model = Sequential()
  model.add(Convolution1D(nb_filter=32, filter_length=3, 
  activation='relu',input_shape = (500000, 3253)))        
  </code></pre>
  
  <p>It gives this error: </p>
  
  <pre><code>/home/.local/lib/python2.7/site-packages/keras/models.py:834: UserWarning: The `nb_epoch` argument in `fit` has been renamed `epochs`.
    warnings.warn('The `nb_epoch` argument in `fit` '
  Traceback (most recent call last):
    File "CNN_Based_Attack.py", line 113, in &lt;module&gt;
      model.fit(x_train, y_train, batch_size=15, nb_epoch=30)
    File "/home/.local/lib/python2.7/site-packages/keras/models.py", line 853, in fit
      initial_epoch=initial_epoch)
    File "/home/.local/lib/python2.7/site-packages/keras/engine/training.py", line 1424, in fit
      batch_size=batch_size)
    File "/home/.local/lib/python2.7/site-packages/keras/engine/training.py", line 1300, in _standardize_user_data
      exception_prefix='input')
    File "/home/.local/lib/python2.7/site-packages/keras/engine/training.py", line 127, in _standardize_input_data
      str(array.shape))
  ValueError: Error when checking input: expected conv1d_1_input to have 3 dimensions, but got array with shape (500000, 3253)
  </code></pre>
  
  <p>I really don't know how to resolve it. </p>